fix default server is reset on automatic update subscribe 2

This commit is contained in:
Qixiny 2021-10-22 20:33:18 +08:00
parent ce635b6071
commit ebf2c23419

View file

@ -1364,9 +1364,18 @@ namespace v2rayN.Forms
if (config.autoUpdateSubscribe) if (config.autoUpdateSubscribe)
{ {
ShowMsg(UIRes.I18N("StartAutoUpdateSubscribe")); ShowMsg(UIRes.I18N("StartAutoUpdateSubscribe"));
ShowMsg(config.index.ToString()); int lastIndex = config.index;
UpdateSubscriptionProcess(); void _updateUI(bool success, string msg)
SetDefaultServer(config.index); {
AppendText(false, msg);
if (success)
{
RefreshServers();
}
SetDefaultServer(lastIndex);
};
(new UpdateHandle()).UpdateSubscriptionProcess(config, _updateUI);
} }
} }