mirror of
https://github.com/ppy/osu
synced 2025-02-09 14:47:33 +00:00
Fix profile badges potentially showing on incorrect profile when switching users
Closes https://github.com/ppy/osu/issues/17081.
This commit is contained in:
parent
eeb7d359ec
commit
3a37e6e8b1
@ -1,6 +1,7 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System.Threading;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
@ -63,11 +64,15 @@ namespace osu.Game.Overlays.Profile.Header
|
||||
};
|
||||
}
|
||||
|
||||
private CancellationTokenSource cancellationTokenSource;
|
||||
|
||||
private void updateDisplay(APIUser user)
|
||||
{
|
||||
var badges = user.Badges;
|
||||
badgeFlowContainer.Clear();
|
||||
|
||||
cancellationTokenSource?.Cancel();
|
||||
|
||||
if (badges?.Length > 0)
|
||||
{
|
||||
Show();
|
||||
@ -79,7 +84,7 @@ namespace osu.Game.Overlays.Profile.Header
|
||||
{
|
||||
// load in stable order regardless of async load order.
|
||||
badgeFlowContainer.Insert(displayIndex, asyncBadge);
|
||||
});
|
||||
}, (cancellationTokenSource = new CancellationTokenSource()).Token);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user