1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 08:22:56 +08:00

fix requests not cancelling properly + formatting

This commit is contained in:
Aergwyn 2018-01-05 19:13:54 +01:00
parent 35297f000c
commit 140a09ba3d

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)
{