Skip to content

Commit

Permalink
Disable sync button if it's running CheckDb
Browse files Browse the repository at this point in the history
  • Loading branch information
neon-nyan committed Nov 24, 2024
1 parent bf9bda3 commit 91c4076
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions CollapseLauncher/XAMLs/MainApp/Pages/HomePage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit 91c4076

Please sign in to comment.