Preserve subscription profiles on failed import (#10429)

This commit is contained in:
Wu Shuwen
2026-11-01 20:43:48 +08:00
committed by GitHub
parent ad3e24b6b5
commit 7e14cf9773
2 changed files with 40 additions and 1 deletions
+5 -1
View File
@@ -2134,7 +2134,6 @@ public static class ConfigHandler
{
lstOriSub = await AppManager.Instance.ProfileItems(subid);
activeProfile = lstOriSub?.FirstOrDefault(t => t.IndexId == config.IndexId);
await RemoveServersViaSubid(config, subid, true);
}
var counter = 0;
@@ -2194,6 +2193,11 @@ public static class ConfigHandler
counter = await AddBatchServers4Custom(config, strData, subid, isSub);
}
if (counter > 0 && lstOriSub is { Count: > 0 })
{
await RemoveServers(config, lstOriSub.Where(item => item.IsSub).ToList());
}
//Select active node
if (activeProfile != null)
{