From cc7089c3f4ce3706cdccd483ae0b2bf1911952ed Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 24 Dec 2021 19:00:09 +0900 Subject: [PATCH] Cancel more liberally --- osu.Game/Overlays/BeatmapListingOverlay.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/BeatmapListingOverlay.cs b/osu.Game/Overlays/BeatmapListingOverlay.cs index ab4ff3edc2..0c2bad95d6 100644 --- a/osu.Game/Overlays/BeatmapListingOverlay.cs +++ b/osu.Game/Overlays/BeatmapListingOverlay.cs @@ -121,6 +121,8 @@ namespace osu.Game.Overlays private CancellationTokenSource cancellationToken; + private Task panelLoadTask; + private void onSearchStarted() { cancellationToken?.Cancel(); @@ -131,10 +133,10 @@ namespace osu.Game.Overlays Loading.Show(); } - private Task panelLoadTask; - private void onSearchFinished(BeatmapListingFilterControl.SearchResult searchResult) { + cancellationToken?.Cancel(); + if (searchResult.Type == BeatmapListingFilterControl.SearchResultType.SupporterOnlyFilters) { supporterRequiredContent.UpdateText(searchResult.SupporterOnlyFiltersUsed); @@ -239,6 +241,8 @@ namespace osu.Game.Overlays var newCards = createCardsFor(foundContent.Reverse().Select(card => card.BeatmapSet)); + cancellationToken?.Cancel(); + panelLoadTask = LoadComponentsAsync(newCards, cards => { foundContent.Clear();