From 91c40766799a7c9664019ffde2818291bd8dca94 Mon Sep 17 00:00:00 2001 From: Kemal Setya Adhi Date: Sun, 24 Nov 2024 16:30:17 +0700 Subject: [PATCH] Disable sync button if it's running CheckDb --- CollapseLauncher/XAMLs/MainApp/Pages/HomePage.xaml.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CollapseLauncher/XAMLs/MainApp/Pages/HomePage.xaml.cs b/CollapseLauncher/XAMLs/MainApp/Pages/HomePage.xaml.cs index 13e5f8ef3..3a5254933 100644 --- a/CollapseLauncher/XAMLs/MainApp/Pages/HomePage.xaml.cs +++ b/CollapseLauncher/XAMLs/MainApp/Pages/HomePage.xaml.cs @@ -2436,6 +2436,10 @@ private async void ResetPlaytimeButton_Click(object sender, RoutedEventArgs e) private async void SyncDbPlaytimeButton_Click(object sender, RoutedEventArgs e) { + Button button = sender as Button; + if (sender != null) + button.IsEnabled = false; + try { SyncDbPlaytimeBtnGlyph.Glyph = "\uf110"; // Loading @@ -2459,6 +2463,11 @@ private async void SyncDbPlaytimeButton_Click(object sender, RoutedEventArgs e) SyncDbPlaytimeBtnGlyph.Glyph = "\uf021"; // Default SyncDbPlaytimeBtnText.Text = Lang._HomePage.GamePlaytime_Idle_SyncDb; } + finally + { + if (sender != null) + button.IsEnabled = true; + } } private void NumberValidationTextBox(TextBox sender, TextBoxBeforeTextChangingEventArgs args)