Skip to content

Commit

Permalink
Schedule the thing
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
frenzibyte committed Nov 26, 2024
1 parent 0a3f3c3 commit b76460f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions osu.Game/Online/LocalUserStatisticsProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ protected override void LoadComplete()
api.LocalUser.BindValueChanged(_ => initialiseStatistics(), true);
}

private void initialiseStatistics()
private void initialiseStatistics() => Schedule(() =>
{
statisticsCache.Clear();
Expand All @@ -59,7 +59,7 @@ private void initialiseStatistics()
foreach (var ruleset in rulesets.AvailableRulesets.Where(r => r.IsLegacyRuleset()))
RefetchStatistics(ruleset);
}
});

public void RefetchStatistics(RulesetInfo ruleset, Action<UserStatisticsUpdate>? callback = null)
{
Expand Down

0 comments on commit b76460f

Please sign in to comment.