Improve state reset flow

This commit is contained in:
Dean Herbert
2019-09-19 15:23:33 +09:00
parent 4967ffd8e5
commit 098e89cb66
3 changed files with 42 additions and 29 deletions

View File

@ -120,9 +120,7 @@ namespace osu.Game.Online.Leaderboards
{
if (value != PlaceholderState.Successful)
{
getScoresRequest?.Cancel();
getScoresRequest = null;
Scores = null;
Reset();
}
if (value == placeholderState)
@ -166,7 +164,7 @@ namespace osu.Game.Online.Leaderboards
protected Leaderboard()
{
Children = new Drawable[]
InternalChildren = new Drawable[]
{
new GridContainer
{
@ -204,6 +202,13 @@ namespace osu.Game.Online.Leaderboards
};
}
protected virtual void Reset()
{
getScoresRequest?.Cancel();
getScoresRequest = null;
Scores = null;
}
private IAPIProvider api;
private ScheduledDelegate pendingUpdateScores;