mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 12:23:22 +08:00
Fix previous badges potentially not being cleared if new user has no badges
This commit is contained in:
parent
e0d58d51b6
commit
318867f486
@ -20,13 +20,12 @@ namespace osu.Game.Overlays.Profile.Header.Components
|
||||
Direction = FillDirection.Horizontal;
|
||||
Spacing = new Vector2(2);
|
||||
|
||||
User.BindValueChanged(val =>
|
||||
{
|
||||
if (val.NewValue?.Groups?.Length > 0)
|
||||
User.BindValueChanged(user =>
|
||||
{
|
||||
Clear(true);
|
||||
Children = val.NewValue?.Groups.Select(g => new GroupBadge(g)).ToList();
|
||||
}
|
||||
|
||||
if (user.NewValue != null)
|
||||
AddRange(user.NewValue.Groups.Select(g => new GroupBadge(g)));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user