mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 07:23:14 +08:00
Fix cancellation token source recreated on every medal
This commit is contained in:
parent
3a37e6e8b1
commit
76c293b9e9
@ -68,10 +68,12 @@ namespace osu.Game.Overlays.Profile.Header
|
||||
|
||||
private void updateDisplay(APIUser user)
|
||||
{
|
||||
var badges = user.Badges;
|
||||
cancellationTokenSource?.Cancel();
|
||||
cancellationTokenSource = new CancellationTokenSource();
|
||||
|
||||
badgeFlowContainer.Clear();
|
||||
|
||||
cancellationTokenSource?.Cancel();
|
||||
var badges = user.Badges;
|
||||
|
||||
if (badges?.Length > 0)
|
||||
{
|
||||
@ -84,7 +86,7 @@ namespace osu.Game.Overlays.Profile.Header
|
||||
{
|
||||
// load in stable order regardless of async load order.
|
||||
badgeFlowContainer.Insert(displayIndex, asyncBadge);
|
||||
}, (cancellationTokenSource = new CancellationTokenSource()).Token);
|
||||
}, cancellationTokenSource.Token);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user