Move scores counter logic to a better place

This commit is contained in:
Andrei Zavatski
2020-09-08 00:04:14 +03:00
parent f88b2509f8
commit 1bc41bcfd7
2 changed files with 16 additions and 15 deletions

View File

@ -44,6 +44,19 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks
}
}
protected override void OnItemsReceived(List<APILegacyScoreInfo> items)
{
base.OnItemsReceived(items);
if (type == ScoreType.Recent)
{
var count = items.Count;
Header.Current.Value = count == 0 ? 0 : -1;
Header.Current.TriggerChange();
}
}
protected override APIRequest<List<APILegacyScoreInfo>> CreateRequest() =>
new GetUserScoresRequest(User.Value.Id, type, VisiblePages++, ItemsPerPage);