Fix subscription ordering

pull/3895/head
2dust 2023-05-21 16:03:29 +08:00
parent 07d2a27b5f
commit 982c865245
1 changed files with 9 additions and 1 deletions

View File

@ -858,10 +858,18 @@ namespace v2rayN.Handler
profileItem.network = Global.DefaultNetwork; profileItem.network = Global.DefaultNetwork;
} }
var maxSort = -1;
if (Utils.IsNullOrEmpty(profileItem.indexId)) if (Utils.IsNullOrEmpty(profileItem.indexId))
{ {
profileItem.indexId = Utils.GetGUID(false); profileItem.indexId = Utils.GetGUID(false);
var maxSort = ProfileExHandler.Instance.GetMaxSort(); maxSort = ProfileExHandler.Instance.GetMaxSort();
}
if (!toFile && maxSort < 0)
{
maxSort = ProfileExHandler.Instance.GetMaxSort();
}
if (maxSort > 0)
{
ProfileExHandler.Instance.SetSort(profileItem.indexId, maxSort + 1); ProfileExHandler.Instance.SetSort(profileItem.indexId, maxSort + 1);
} }