1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 16:32:54 +08:00

Cancel more liberally

This commit is contained in:
Dean Herbert 2021-12-24 19:00:09 +09:00
parent d602aebebb
commit cc7089c3f4

View File

@ -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();