Skip to content

Commit

Permalink
fixed an issue preventing profile delete button from being enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Valkirie committed Jul 6, 2024
1 parent 7cae1f2 commit 4e40b89
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions HandheldCompanion/Views/Pages/ProfilesPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -526,8 +526,9 @@ private void UpdateUI()
Application.Current.Dispatcher.Invoke(() =>
{
// disable delete button if is default profile or any sub profile is running
b_DeleteProfile.IsEnabled = !selectedProfile.ErrorCode.HasFlag(ProfileErrorCode.Default & ProfileErrorCode.Running); //TODO consider sub profiles pertaining to this main profile is running
// prevent user from renaming default profile
//TODO consider sub profiles pertaining to this main profile is running
b_DeleteProfile.IsEnabled = (selectedProfile.ErrorCode & (ProfileErrorCode.Default | ProfileErrorCode.Running)) == 0;
// prevent user from renaming default profile
b_ProfileRename.IsEnabled = !selectedMainProfile.Default;
// prevent user from disabling default profile
Toggle_EnableProfile.IsEnabled = !selectedProfile.Default;
Expand Down

0 comments on commit 4e40b89

Please sign in to comment.