Update ConfigHandler.cs

pull/2148/head
2dust 2022-03-28 19:21:31 +08:00
parent cdc83bc9d7
commit 645e6c4ec0
1 changed files with 6 additions and 7 deletions

View File

@ -747,6 +747,10 @@ namespace v2rayN.Handler
{
vmessItem.indexId = Utils.GetGUID(false);
}
else if (vmessItem.indexId == config.indexId)
{
Global.reloadV2ray = true;
}
if (!config.vmess.Exists(it => it.indexId == vmessItem.indexId))
{
var maxSort = config.vmess.Any() ? config.vmess.Max(t => t.sort) : 0;
@ -755,11 +759,6 @@ namespace v2rayN.Handler
config.vmess.Add(vmessItem);
}
//if (config.vmess.Count == 1)
//{
// config.indexId = config.vmess[0].indexId;
// Global.reloadV2ray = true;
//}
return 0;
}
@ -940,10 +939,10 @@ namespace v2rayN.Handler
vmessItem.coreType = ECoreType.clash;
vmessItem.address = fileName;
vmessItem.remarks = "clash_custom";
}
}
//Is Other configuration
else
{
{
var fileName = Utils.GetTempPath($"{Utils.GetGUID(false)}.txt");
File.WriteAllText(fileName, clipboardData);