1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-05 10:33:22 +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:
Salman Alshamrani 2024-11-26 01:26:44 -05:00
parent 0a3f3c3210
commit b76460f100

View File

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