mirror of
https://github.com/ppy/osu.git
synced 2024-12-05 02:53:21 +08:00
Schedule the thing
Queuing up requests on change to `api.LocalUser` is bad because the API state is updated after `LocalUser` is updated, therefore we have to schhhhhedullllllllleeeeeeeeeeeeeeee.
This commit is contained in:
parent
0a3f3c3210
commit
b76460f100
@ -50,7 +50,7 @@ namespace osu.Game.Online
|
||||
api.LocalUser.BindValueChanged(_ => initialiseStatistics(), true);
|
||||
}
|
||||
|
||||
private void initialiseStatistics()
|
||||
private void initialiseStatistics() => Schedule(() =>
|
||||
{
|
||||
statisticsCache.Clear();
|
||||
|
||||
@ -59,7 +59,7 @@ namespace osu.Game.Online
|
||||
|
||||
foreach (var ruleset in rulesets.AvailableRulesets.Where(r => r.IsLegacyRuleset()))
|
||||
RefetchStatistics(ruleset);
|
||||
}
|
||||
});
|
||||
|
||||
public void RefetchStatistics(RulesetInfo ruleset, Action<UserStatisticsUpdate>? callback = null)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user