Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
peppy committed Feb 5, 2025
1 parent 8c5b19d commit 5d8c01b
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions osu.Game/Screens/SelectV2/Carousel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,6 @@ protected Carousel()

private async Task performFilter()
{
Debug.Assert(SynchronizationContext.Current != null);

Stopwatch stopwatch = Stopwatch.StartNew();
var cts = new CancellationTokenSource();

Expand Down Expand Up @@ -266,19 +264,22 @@ await Task.Run(async () =>
{
log("Cancelled due to newer request arriving");
}
}, cts.Token).ConfigureAwait(true);
}, cts.Token).ConfigureAwait(false);

if (cts.Token.IsCancellationRequested)
return;

log("Items ready for display");
carouselItems = items.ToList();
displayedRange = null;
Schedule(() =>
{
log("Items ready for display");
carouselItems = items.ToList();
displayedRange = null;

// Need to call this to ensure correct post-selection logic is handled on the new items list.
HandleItemSelected(currentSelection.Model);
// Need to call this to ensure correct post-selection logic is handled on the new items list.
HandleItemSelected(currentSelection.Model);

refreshAfterSelection();
refreshAfterSelection();
});

void log(string text) => Logger.Log($"Carousel[op {cts.GetHashCode().ToString()}] {stopwatch.ElapsedMilliseconds} ms: {text}");
}
Expand Down

0 comments on commit 5d8c01b

Please sign in to comment.