1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 10:12:54 +08:00

Fix previous badges potentially not being cleared if new user has no badges

This commit is contained in:
Dean Herbert 2023-01-11 16:48:47 +09:00
parent e0d58d51b6
commit 318867f486

View File

@ -20,13 +20,12 @@ namespace osu.Game.Overlays.Profile.Header.Components
Direction = FillDirection.Horizontal;
Spacing = new Vector2(2);
User.BindValueChanged(val =>
User.BindValueChanged(user =>
{
if (val.NewValue?.Groups?.Length > 0)
{
Clear(true);
Children = val.NewValue?.Groups.Select(g => new GroupBadge(g)).ToList();
}
Clear(true);
if (user.NewValue != null)
AddRange(user.NewValue.Groups.Select(g => new GroupBadge(g)));
});
}
}