From 158bde237578d58d94f6d956fdaa848b520b158e Mon Sep 17 00:00:00 2001 From: Cyberboss Date: Wed, 8 Nov 2017 13:54:21 -0500 Subject: [PATCH] Fixes on/offlining an instance in the CP not updating the list --- TGControlPanel/InstanceSelector.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/TGControlPanel/InstanceSelector.cs b/TGControlPanel/InstanceSelector.cs index 318b3d5c30..82a92efc08 100644 --- a/TGControlPanel/InstanceSelector.cs +++ b/TGControlPanel/InstanceSelector.cs @@ -25,6 +25,10 @@ namespace TGControlPanel /// bool UpdatingEnabledCheckbox = false; + /// + /// Construct an + /// + /// An connected a the public InstanceSelector(IInterface I) { InitializeComponent(); @@ -248,9 +252,11 @@ namespace TGControlPanel if (MessageBox.Show(String.Format("Are you sure you want to {0} this instance?", enabling ? "online" : "offline"), "Instance Status Change", MessageBoxButtons.YesNo) != DialogResult.Yes) return; string res = null; - await WrapServerOp(() => res = masterInterface.GetServiceComponent().SetInstanceEnabled(InstanceData[InstanceListBox.SelectedIndex].Name, enabling)); + var index = InstanceListBox.SelectedIndex; + await WrapServerOp(() => res = masterInterface.GetServiceComponent().SetInstanceEnabled(InstanceData[index].Name, enabling)); if (res != null) MessageBox.Show(res); + RefreshInstances(); } ///