Fix SeasonalBackgroundLoader triggering a background reload when not providing backgrounds

This commit is contained in:
Dean Herbert 2022-07-08 01:37:43 +09:00
parent 0d25b63769
commit b83073c2e9

View File

@ -41,7 +41,11 @@ namespace osu.Game.Graphics.Backgrounds
seasonalBackgroundMode.BindValueChanged(_ => SeasonalBackgroundChanged?.Invoke());
seasonalBackgrounds = sessionStatics.GetBindable<APISeasonalBackgrounds>(Static.SeasonalBackgrounds);
seasonalBackgrounds.BindValueChanged(_ => SeasonalBackgroundChanged?.Invoke());
seasonalBackgrounds.BindValueChanged(response =>
{
if (response.NewValue?.Backgrounds?.Count > 0)
SeasonalBackgroundChanged?.Invoke();
});
apiState.BindTo(api.State);
apiState.BindValueChanged(fetchSeasonalBackgrounds, true);