Browse Source

delete old server when update online config url

tags/4.2.1.0
Student Main 4 years ago
parent
commit
0cbb581b41
No known key found for this signature in database GPG Key ID: AA78519C208C8742
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      shadowsocks-csharp/View/OnlineConfigForm.cs

+ 5
- 1
shadowsocks-csharp/View/OnlineConfigForm.cs View File

@@ -91,15 +91,19 @@ namespace Shadowsocks.View

private async void UpdateButton_Click(object sender, EventArgs e)
{
string old = (string)UrlListBox.SelectedItem;
// update content, also update online config
Commit();
string current = (string)UrlListBox.SelectedItem;
if (UrlListBox.Items.Count == 0) return;
tableLayoutPanel1.Enabled = false;
bool ok = await controller.UpdateOnlineConfig((string)UrlListBox.SelectedItem);
bool ok = await controller.UpdateOnlineConfig(current);
if (!ok)
{
MessageBox.Show(I18N.GetString("online config failed to update"));
return;
}
if (old != current) controller.RemoveOnlineConfig(old);
tableLayoutPanel1.Enabled = true;
}



Loading…
Cancel
Save