diff --git a/osu.Game/Online/API/APIAccess.cs b/osu.Game/Online/API/APIAccess.cs index 70cd21b2db..08bb9472c1 100644 --- a/osu.Game/Online/API/APIAccess.cs +++ b/osu.Game/Online/API/APIAccess.cs @@ -77,13 +77,13 @@ namespace osu.Game.Online.API /// public void Register(IOnlineComponent component) { - Scheduler.Add(delegate { components.Add(component); }); + Schedule(() => components.Add(component)); component.APIStateChanged(this, state); } public void Unregister(IOnlineComponent component) { - Scheduler.Add(delegate { components.Remove(component); }); + Schedule(() => components.Remove(component)); } public string AccessToken => authentication.RequestAccessToken(); @@ -274,7 +274,7 @@ namespace osu.Game.Online.API state = value; log.Add($@"We just went {state}!"); - Scheduler.Add(delegate + Schedule(() => { components.ForEach(c => c.APIStateChanged(this, state)); OnStateChange?.Invoke(oldState, state);