mirror of
https://github.com/ppy/osu
synced 2025-02-21 13:07:18 +00: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) =>
|
TextBox.OnCommit += (sender, newText) =>
|
||||||
{
|
{
|
||||||
if (newText && !string.IsNullOrEmpty(TextBox.Current.Value))
|
if (string.IsNullOrEmpty(TextBox.Text))
|
||||||
realm.Write(r => r.Add(new BeatmapCollection(TextBox.Current.Value)));
|
return;
|
||||||
|
|
||||||
|
realm.Write(r => r.Add(new BeatmapCollection(TextBox.Text)));
|
||||||
TextBox.Text = string.Empty;
|
TextBox.Text = string.Empty;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -114,7 +114,7 @@ namespace osu.Game.Collections
|
|||||||
|
|
||||||
private void onCommit(TextBox sender, bool newText)
|
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);
|
collection.PerformWrite(c => c.Name = TextBox.Current.Value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user