mirror of
https://github.com/ppy/osu.git
synced 2025-02-19 11:23:23 +08:00
Fix collection dropdown potentially overwriting value change with schedule hotfix
This commit is contained in:
parent
9a579871c0
commit
db004c9d9f
@ -75,7 +75,14 @@ namespace osu.Game.Collections
|
|||||||
// changes. It's not great but honestly the whole dropdown menu structure isn't great. This needs to be fixed, but I'll issue
|
// changes. It's not great but honestly the whole dropdown menu structure isn't great. This needs to be fixed, but I'll issue
|
||||||
// a warning that it's going to be a frustrating journey.
|
// a warning that it's going to be a frustrating journey.
|
||||||
Current.Value = allBeatmaps;
|
Current.Value = allBeatmaps;
|
||||||
Schedule(() => Current.Value = filters.SingleOrDefault(f => f.Collection != null && f.Collection.ID == selectedItem?.ID) ?? filters[0]);
|
Schedule(() =>
|
||||||
|
{
|
||||||
|
// current may have changed before the scheduled call is run.
|
||||||
|
if (Current.Value != allBeatmaps)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Current.Value = filters.SingleOrDefault(f => f.Collection != null && f.Collection.ID == selectedItem?.ID) ?? filters[0];
|
||||||
|
});
|
||||||
|
|
||||||
// Trigger a re-filter if the current item was in the change set.
|
// Trigger a re-filter if the current item was in the change set.
|
||||||
if (selectedItem != null && changes != null)
|
if (selectedItem != null && changes != null)
|
||||||
|
Loading…
Reference in New Issue
Block a user