1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 10:52:53 +08:00

Schedule entire operation for safety

Also removes a redundant list copy.
This commit is contained in:
Bartłomiej Dach 2021-01-19 18:46:21 +01:00
parent 78e590d25d
commit 3b49b7461e

View File

@ -133,9 +133,12 @@ namespace osu.Game.Overlays.Settings.Sections
{
if (weakItem.NewValue.TryGetTarget(out var item))
{
List<SkinInfo> newDropdownItems = skinDropdown.Items.Where(i => !i.Equals(item)).Append(item).ToList();
sortUserSkins(newDropdownItems);
Schedule(() => skinDropdown.Items = newDropdownItems.ToArray());
Schedule(() =>
{
List<SkinInfo> newDropdownItems = skinDropdown.Items.Where(i => !i.Equals(item)).Append(item).ToList();
sortUserSkins(newDropdownItems);
skinDropdown.Items = newDropdownItems;
});
}
}