Skip to content

Commit 91c4076

Browse files
committed
Disable sync button if it's running CheckDb
1 parent bf9bda3 commit 91c4076

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

CollapseLauncher/XAMLs/MainApp/Pages/HomePage.xaml.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2436,6 +2436,10 @@ private async void ResetPlaytimeButton_Click(object sender, RoutedEventArgs e)
24362436

24372437
private async void SyncDbPlaytimeButton_Click(object sender, RoutedEventArgs e)
24382438
{
2439+
Button button = sender as Button;
2440+
if (sender != null)
2441+
button.IsEnabled = false;
2442+
24392443
try
24402444
{
24412445
SyncDbPlaytimeBtnGlyph.Glyph = "\uf110"; // Loading
@@ -2459,6 +2463,11 @@ private async void SyncDbPlaytimeButton_Click(object sender, RoutedEventArgs e)
24592463
SyncDbPlaytimeBtnGlyph.Glyph = "\uf021"; // Default
24602464
SyncDbPlaytimeBtnText.Text = Lang._HomePage.GamePlaytime_Idle_SyncDb;
24612465
}
2466+
finally
2467+
{
2468+
if (sender != null)
2469+
button.IsEnabled = true;
2470+
}
24622471
}
24632472

24642473
private void NumberValidationTextBox(TextBox sender, TextBoxBeforeTextChangingEventArgs args)

0 commit comments

Comments
 (0)