mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 12:33:01 +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;
|
Direction = FillDirection.Horizontal;
|
||||||
Spacing = new Vector2(2);
|
Spacing = new Vector2(2);
|
||||||
|
|
||||||
User.BindValueChanged(val =>
|
User.BindValueChanged(user =>
|
||||||
{
|
{
|
||||||
if (val.NewValue?.Groups?.Length > 0)
|
Clear(true);
|
||||||
{
|
|
||||||
Clear(true);
|
if (user.NewValue != null)
|
||||||
Children = val.NewValue?.Groups.Select(g => new GroupBadge(g)).ToList();
|
AddRange(user.NewValue.Groups.Select(g => new GroupBadge(g)));
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user