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:
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 =>
|
||||
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)));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user