1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 09:32:55 +08:00

Move cancellation to safer place

This commit is contained in:
Dean Herbert 2019-01-07 19:31:05 +09:00
parent d72412d24d
commit 8eedef3e86

View File

@ -51,6 +51,10 @@ namespace osu.Game.Online.Leaderboards
loading.Hide();
// schedule because we may not be loaded yet (LoadComponentAsync complains).
showScoresDelegate?.Cancel();
showScoresCancellationSource?.Cancel();
if (scores == null || !scores.Any())
return;
@ -60,10 +64,6 @@ namespace osu.Game.Online.Leaderboards
scrollFlow = CreateScoreFlow();
scrollFlow.ChildrenEnumerable = scores.Select((s, index) => CreateDrawableScore(s, index + 1));
// schedule because we may not be loaded yet (LoadComponentAsync complains).
showScoresDelegate?.Cancel();
showScoresCancellationSource?.Cancel();
if (!IsLoaded)
showScoresDelegate = Schedule(showScores);
else