1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 12:42:54 +08:00

Merge pull request #1858 from Aergwyn/fix-leaderboard-requests

Fix Leaderboard loading scores multiple times
This commit is contained in:
Dean Herbert 2018-01-08 20:30:34 +09:00 committed by GitHub
commit 805e91c625
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -93,7 +93,8 @@ namespace osu.Game.Screens.Select.Leaderboards
get { return scope; }
set
{
if (value == scope) return;
if (value == scope)
return;
scope = value;
updateScores();
@ -107,8 +108,6 @@ namespace osu.Game.Screens.Select.Leaderboards
get { return placeholderState; }
set
{
if (value == placeholderState) return;
if (value != PlaceholderState.Successful)
{
getScoresRequest?.Cancel();
@ -116,6 +115,9 @@ namespace osu.Game.Screens.Select.Leaderboards
Scores = null;
}
if (value == placeholderState)
return;
switch (placeholderState = value)
{
case PlaceholderState.NetworkFailure:
@ -171,7 +173,8 @@ namespace osu.Game.Screens.Select.Leaderboards
get { return beatmap; }
set
{
if (beatmap == value) return;
if (beatmap == value)
return;
beatmap = value;
Scores = null;
@ -259,7 +262,8 @@ namespace osu.Game.Screens.Select.Leaderboards
private void onUpdateFailed(Exception e)
{
if (e is OperationCanceledException) return;
if (e is OperationCanceledException)
return;
PlaceholderState = PlaceholderState.NetworkFailure;
Logger.Error(e, @"Couldn't fetch beatmap scores!");
@ -294,7 +298,8 @@ namespace osu.Game.Screens.Select.Leaderboards
if (!scrollContainer.IsScrolledToEnd())
fadeStart -= LeaderboardScore.HEIGHT;
if (scrollFlow == null) return;
if (scrollFlow == null)
return;
foreach (var c in scrollFlow.Children)
{