mirror of
https://github.com/2dust/v2rayN.git
synced 2025-08-24 11:56:55 +00:00
first, index will be -1.
This commit is contained in:
parent
55ae62c66a
commit
d2300798d5
1 changed files with 26 additions and 19 deletions
|
@ -1339,27 +1339,34 @@ namespace v2rayN.Forms
|
||||||
}
|
}
|
||||||
private void tsbSubUpdate_Click(object sender, EventArgs e)
|
private void tsbSubUpdate_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
VmessItem item = config.vmess[config.index];
|
try
|
||||||
var remarks = item.remarks;
|
|
||||||
var handle = new UpdateHandle();
|
|
||||||
void _updateUIAndReselect(bool success, string msg)
|
|
||||||
{
|
{
|
||||||
AppendText(false, msg);
|
VmessItem item = config.vmess[config.index];
|
||||||
if (success)
|
var remarks = item.remarks;
|
||||||
|
var handle = new UpdateHandle();
|
||||||
|
void _updateUIAndReselect(bool success, string msg)
|
||||||
{
|
{
|
||||||
RefreshServers();
|
AppendText(false, msg);
|
||||||
}
|
if (success)
|
||||||
if (handle.updateSubscriptionProcessCompleted)
|
{
|
||||||
{
|
RefreshServers();
|
||||||
// wait for above fxcking async program to complete
|
}
|
||||||
int index = FindIndexByRemarks(remarks);
|
if (handle.updateSubscriptionProcessCompleted)
|
||||||
SetDefaultServer(index);
|
{
|
||||||
AppendText(false, $"{UIRes.I18N("MsgUpdateSubscriptionEndReslectLast")}");
|
// wait for above fxcking async program to complete
|
||||||
RefreshServers();
|
int index = FindIndexByRemarks(remarks);
|
||||||
handle.updateSubscriptionProcessCompleted = false;
|
SetDefaultServer(index);
|
||||||
}
|
AppendText(false, $"{UIRes.I18N("MsgUpdateSubscriptionEndReslectLast")}");
|
||||||
};
|
RefreshServers();
|
||||||
handle.UpdateSubscriptionProcess(config, _updateUIAndReselect);
|
handle.updateSubscriptionProcessCompleted = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
handle.UpdateSubscriptionProcess(config, _updateUIAndReselect);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
UpdateSubscriptionProcess();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// the subscription update process
|
/// the subscription update process
|
||||||
|
|
Loading…
Reference in a new issue