1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 17:47:29 +08:00

Merge pull request #5456 from peppy/fix-import-select

Fix beatmap present failing directly after an import
This commit is contained in:
Dean Herbert 2019-07-26 18:48:49 +09:00 committed by GitHub
commit 392e1cbafb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -81,7 +81,8 @@ namespace osu.Game.Screens.Select
itemsCache.Invalidate();
scrollPositionCache.Invalidate();
Schedule(() =>
// Run on late scheduler want to ensure this runs after all pending UpdateBeatmapSet / RemoveBeatmapSet operations are run.
SchedulerAfterChildren.Add(() =>
{
BeatmapSetsChanged?.Invoke();
BeatmapSetsLoaded = true;
@ -129,19 +130,16 @@ namespace osu.Game.Screens.Select
loadBeatmapSets(beatmaps.GetAllUsableBeatmapSetsEnumerable());
}
public void RemoveBeatmapSet(BeatmapSetInfo beatmapSet)
public void RemoveBeatmapSet(BeatmapSetInfo beatmapSet) => Schedule(() =>
{
Schedule(() =>
{
var existingSet = beatmapSets.FirstOrDefault(b => b.BeatmapSet.ID == beatmapSet.ID);
var existingSet = beatmapSets.FirstOrDefault(b => b.BeatmapSet.ID == beatmapSet.ID);
if (existingSet == null)
return;
if (existingSet == null)
return;
root.RemoveChild(existingSet);
itemsCache.Invalidate();
});
}
root.RemoveChild(existingSet);
itemsCache.Invalidate();
});
public void UpdateBeatmapSet(BeatmapSetInfo beatmapSet) => Schedule(() =>
{