Merge branch 'profile-hover-staff-badges-fix' into 'develop'

ProfileHoverCard: fix redundant staff badges

Closes #690

See merge request soapbox-pub/soapbox-fe!622
This commit is contained in:
Alex Gleason 2021-07-15 16:57:29 +00:00
commit e978c1ca3b

View file

@ -20,9 +20,17 @@ const getAccount = makeGetAccount();
const getBadges = (account) => {
let badges = [];
if (isAdmin(account)) badges.push(<Badge key='admin' slug='admin' title='Admin' />);
if (isModerator(account)) badges.push(<Badge key='moderator' slug='moderator' title='Moderator' />);
if (account.getIn(['patron', 'is_patron'])) badges.push(<Badge key='patron' slug='patron' title='Patron' />);
if (isAdmin(account)) {
badges.push(<Badge key='admin' slug='admin' title='Admin' />);
} else if (isModerator(account)) {
badges.push(<Badge key='moderator' slug='moderator' title='Moderator' />);
}
if (account.getIn(['patron', 'is_patron'])) {
badges.push(<Badge key='patron' slug='patron' title='Patron' />);
}
return badges;
};