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:
parent
ebe9a9f083
commit
17b1888c59
@ -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;
|
||||
};
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user