bug fixes
This commit is contained in:
@@ -972,46 +972,40 @@ namespace v2rayN.Handler
|
||||
}
|
||||
profileItem.subid = subid;
|
||||
profileItem.isSub = isSub;
|
||||
var addStatus = -1;
|
||||
|
||||
if (profileItem.configType == EConfigType.VMess)
|
||||
{
|
||||
if (AddServer(ref config, profileItem, false) == 0)
|
||||
{
|
||||
countServers++;
|
||||
}
|
||||
addStatus = AddServer(ref config, profileItem, false);
|
||||
}
|
||||
else if (profileItem.configType == EConfigType.Shadowsocks)
|
||||
{
|
||||
if (AddShadowsocksServer(ref config, profileItem, false) == 0)
|
||||
{
|
||||
countServers++;
|
||||
}
|
||||
addStatus = AddShadowsocksServer(ref config, profileItem, false);
|
||||
}
|
||||
else if (profileItem.configType == EConfigType.Socks)
|
||||
{
|
||||
if (AddSocksServer(ref config, profileItem, false) == 0)
|
||||
{
|
||||
countServers++;
|
||||
}
|
||||
addStatus = AddSocksServer(ref config, profileItem, false);
|
||||
}
|
||||
else if (profileItem.configType == EConfigType.Trojan)
|
||||
{
|
||||
if (AddTrojanServer(ref config, profileItem, false) == 0)
|
||||
{
|
||||
countServers++;
|
||||
}
|
||||
addStatus = AddTrojanServer(ref config, profileItem, false);
|
||||
}
|
||||
else if (profileItem.configType == EConfigType.VLESS)
|
||||
{
|
||||
if (AddVlessServer(ref config, profileItem, false) == 0)
|
||||
{
|
||||
countServers++;
|
||||
}
|
||||
addStatus = AddVlessServer(ref config, profileItem, false);
|
||||
}
|
||||
|
||||
if (addStatus == 0)
|
||||
{
|
||||
countServers++;
|
||||
lstAdd.Add(profileItem);
|
||||
}
|
||||
lstAdd.Add(profileItem);
|
||||
}
|
||||
|
||||
SqliteHelper.Instance.InsertAll(lstAdd);
|
||||
if (lstAdd.Count > 0)
|
||||
{
|
||||
SqliteHelper.Instance.InsertAll(lstAdd);
|
||||
}
|
||||
|
||||
ToJsonFile(config);
|
||||
return countServers;
|
||||
|
||||
@@ -700,7 +700,7 @@ namespace v2rayN.ViewModels
|
||||
_subId = SelectedSub?.id;
|
||||
_config.subIndexId = _subId;
|
||||
|
||||
RefreshServers(false);
|
||||
RefreshServers();
|
||||
|
||||
_updateView("ProfilesFocus");
|
||||
}
|
||||
@@ -715,13 +715,12 @@ namespace v2rayN.ViewModels
|
||||
RefreshServers();
|
||||
}
|
||||
|
||||
private void RefreshServers(bool blCheckDefault = true)
|
||||
private void RefreshServers()
|
||||
{
|
||||
List<ProfileItemModel> lstModel = LazyConfig.Instance.ProfileItems(_subId, _serverFilter);
|
||||
if (blCheckDefault)
|
||||
{
|
||||
ConfigHandler.SetDefaultServer(_config, lstModel);
|
||||
}
|
||||
|
||||
ConfigHandler.SetDefaultServer(_config, lstModel);
|
||||
|
||||
List<ServerStatItem> lstServerStat = new();
|
||||
if (_statistics != null && _statistics.Enable)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user