Add `Schedule` to ensure correct thread for UI code

This commit is contained in:
Dean Herbert 2023-06-23 14:07:33 +09:00
parent ce1579f2fe
commit 343271751a
1 changed files with 2 additions and 2 deletions

View File

@ -176,7 +176,7 @@ protected override void LoadComplete()
private void updateCommitButtonState() =>
commitButton.Enabled.Value = loadingSpinner.State.Value == Visibility.Hidden && !string.IsNullOrEmpty(Current.Value);
private void updateStateForLoggedIn(ValueChangedEvent<APIState> state)
private void updateStateForLoggedIn(ValueChangedEvent<APIState> state) => Schedule(() =>
{
bool isAvailable = state.NewValue > APIState.Offline;
@ -193,7 +193,7 @@ private void updateStateForLoggedIn(ValueChangedEvent<APIState> state)
commitButton.Hide();
logInButton.Show();
}
}
});
private partial class EditorTextBox : OsuTextBox
{