Fix beatmap overlay not re-fetching results after login

This commit is contained in:
Dean Herbert 2022-02-22 14:55:52 +09:00
parent a676acd80d
commit d6032a2335

View File

@ -67,6 +67,8 @@ namespace osu.Game.Overlays.BeatmapListing
[Resolved] [Resolved]
private IAPIProvider api { get; set; } private IAPIProvider api { get; set; }
private IBindable<APIUser> apiUser;
public BeatmapListingFilterControl() public BeatmapListingFilterControl()
{ {
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
@ -127,7 +129,7 @@ namespace osu.Game.Overlays.BeatmapListing
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OverlayColourProvider colourProvider) private void load(OverlayColourProvider colourProvider, IAPIProvider api)
{ {
sortControlBackground.Colour = colourProvider.Background4; sortControlBackground.Colour = colourProvider.Background4;
} }
@ -161,6 +163,9 @@ namespace osu.Game.Overlays.BeatmapListing
sortCriteria.BindValueChanged(_ => queueUpdateSearch()); sortCriteria.BindValueChanged(_ => queueUpdateSearch());
sortDirection.BindValueChanged(_ => queueUpdateSearch()); sortDirection.BindValueChanged(_ => queueUpdateSearch());
apiUser = api.LocalUser.GetBoundCopy();
apiUser.BindValueChanged(_ => queueUpdateSearch());
} }
public void TakeFocus() => searchControl.TakeFocus(); public void TakeFocus() => searchControl.TakeFocus();
@ -190,6 +195,9 @@ namespace osu.Game.Overlays.BeatmapListing
resetSearch(); resetSearch();
if (!api.IsLoggedIn)
return;
queryChangedDebounce = Scheduler.AddDelayed(() => queryChangedDebounce = Scheduler.AddDelayed(() =>
{ {
resetSearch(); resetSearch();