1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 11:42:56 +08:00

use runOnceImmediately instead of duplicating logic

This commit is contained in:
Liam DeVoe 2023-06-19 18:20:16 -04:00
parent 591277e0f9
commit f7dde53f9b

View File

@ -88,9 +88,7 @@ namespace osu.Game.Overlays.Comments
{
Height = 40,
RelativeSizeAxes = Axes.X,
PlaceholderText = GetTextBoxPlaceholder(API.IsLoggedIn),
Current = Current,
ReadOnly = !API.IsLoggedIn
Current = Current
},
new Container
{
@ -126,7 +124,6 @@ namespace osu.Game.Overlays.Comments
Spacing = new Vector2(5, 0),
Child = commitButton = new EditorButton
{
Text = GetCommitButtonText(API.IsLoggedIn),
Action = () => commitOrLogIn(Current.Value)
}
},
@ -152,7 +149,7 @@ namespace osu.Game.Overlays.Comments
{
base.LoadComplete();
Current.BindValueChanged(_ => updateCommitButtonState(), true);
User.BindValueChanged(_ => updateStateForLoggedIn());
User.BindValueChanged(_ => updateStateForLoggedIn(), true);
}
protected abstract void OnCommit(string text);