Consolidate flows of Set operations, either result or error

This commit is contained in:
Dean Herbert
2022-01-30 16:16:00 +09:00
parent c401629dd8
commit acc1199add
4 changed files with 37 additions and 59 deletions

View File

@ -93,12 +93,6 @@ namespace osu.Game.Screens.Select.Leaderboards
};
}
protected override void Reset()
{
base.Reset();
TopScore = null;
}
protected override bool IsOnlineScope => Scope != BeatmapLeaderboardScope.Local;
protected override APIRequest FetchScores(CancellationToken cancellationToken)
@ -153,8 +147,7 @@ namespace osu.Game.Screens.Select.Leaderboards
if (cancellationToken.IsCancellationRequested)
return;
Scores = task.GetResultSafely();
TopScore = r.UserScore?.CreateScoreInfo(rulesets, fetchBeatmapInfo);
SetScores(task.GetResultSafely(), r.UserScore?.CreateScoreInfo(rulesets, fetchBeatmapInfo));
}), TaskContinuationOptions.OnlyOnRanToCompletion);
};
@ -210,7 +203,7 @@ namespace osu.Game.Screens.Select.Leaderboards
scoreManager.OrderByTotalScoreAsync(scores.ToArray(), cancellationToken)
.ContinueWith(ordered =>
{
Scores = ordered.GetResultSafely();
SetScores(ordered.GetResultSafely());
}, TaskContinuationOptions.OnlyOnRanToCompletion);
}
}