1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 16:27:26 +08:00

Fix callback potentially not getting fired

This commit is contained in:
Dean Herbert 2019-03-01 20:52:34 +09:00
parent 19ce1f2869
commit c01990d005
2 changed files with 4 additions and 2 deletions

View File

@ -29,7 +29,7 @@ namespace osu.Game.Screens.Select
Action = () =>
{
Task.Run(() => scoreManager.Delete(scoreManager.QueryScores(s => !s.DeletePending && s.Beatmap.ID == beatmap.ID).ToList()))
.ContinueWith(t => Schedule(onCompletion));
.ContinueWith(_ => onCompletion);
}
},
new PopupDialogCancelButton

View File

@ -625,7 +625,9 @@ namespace osu.Game.Screens.Select
{
if (beatmap == null || beatmap.ID <= 0) return;
dialogOverlay?.Push(new BeatmapClearScoresDialog(beatmap, () => BeatmapDetails.Leaderboard.RefreshScores()));
dialogOverlay?.Push(new BeatmapClearScoresDialog(beatmap, () =>
// schedule done here rather than inside the dialog as the dialog may fade out and never callback.
Schedule(() => BeatmapDetails.Leaderboard.RefreshScores())));
}
public override bool OnPressed(GlobalAction action)