mirror of https://github.com/ppy/osu
Reduce isLoading calls
This commit is contained in:
parent
d157e6baf1
commit
fa6d3f9792
|
@ -105,22 +105,16 @@ private void updateScores()
|
|||
flow.Clear();
|
||||
|
||||
if (scoresAmount < 2)
|
||||
{
|
||||
IsLoading = false;
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 1; i < scoresAmount; i++)
|
||||
flow.Add(new DrawableScore(i, scores.ElementAt(i)));
|
||||
|
||||
IsLoading = false;
|
||||
}
|
||||
|
||||
public void CleanAllScores()
|
||||
{
|
||||
topScore.Hide();
|
||||
flow.Clear();
|
||||
IsLoading = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -92,8 +92,6 @@ public BeatmapSetOverlay()
|
|||
|
||||
private void updateScores(BeatmapInfo beatmap)
|
||||
{
|
||||
scores.IsLoading = true;
|
||||
|
||||
getScoresRequest?.Cancel();
|
||||
|
||||
if (!beatmap.OnlineBeatmapID.HasValue)
|
||||
|
@ -102,9 +100,14 @@ private void updateScores(BeatmapInfo beatmap)
|
|||
return;
|
||||
}
|
||||
|
||||
getScoresRequest = new GetScoresRequest(beatmap);
|
||||
getScoresRequest.Success += r => scores.Scores = r.Scores;
|
||||
scores.IsLoading = true;
|
||||
|
||||
getScoresRequest = new GetScoresRequest(beatmap);
|
||||
getScoresRequest.Success += r =>
|
||||
{
|
||||
scores.Scores = r.Scores;
|
||||
scores.IsLoading = false;
|
||||
};
|
||||
api.Queue(getScoresRequest);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue