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