1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-05 17:02:58 +08:00

Avoid using newTexst as it doesn't work well with tests

This commit is contained in:
Dean Herbert 2024-11-14 14:23:43 +09:00
parent ebe9a9f083
commit 17b1888c59
No known key found for this signature in database
2 changed files with 5 additions and 3 deletions

View File

@ -162,8 +162,10 @@ namespace osu.Game.Collections
TextBox.OnCommit += (sender, newText) =>
{
if (newText && !string.IsNullOrEmpty(TextBox.Current.Value))
realm.Write(r => r.Add(new BeatmapCollection(TextBox.Current.Value)));
if (string.IsNullOrEmpty(TextBox.Text))
return;
realm.Write(r => r.Add(new BeatmapCollection(TextBox.Text)));
TextBox.Text = string.Empty;
};
}

View File

@ -114,7 +114,7 @@ namespace osu.Game.Collections
private void onCommit(TextBox sender, bool newText)
{
if (collection.IsManaged && newText)
if (collection.IsManaged && collection.Value.Name != TextBox.Current.Value)
collection.PerformWrite(c => c.Name = TextBox.Current.Value);
}
}