v2 Suggestions: conditionally display admin actions

This commit is contained in:
Alex Gleason 2021-11-26 23:53:50 -06:00
parent 92439137c1
commit 4c11a3041f
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -407,18 +407,20 @@ class Header extends ImmutablePureComponent {
});
}
if (account.getIn(['pleroma', 'is_suggested'])) {
menu.push({
text: intl.formatMessage(messages.unsuggestUser, { name: account.get('username') }),
action: this.props.onUnsuggestUser,
icon: require('@tabler/icons/icons/user-x.svg'),
});
} else {
menu.push({
text: intl.formatMessage(messages.suggestUser, { name: account.get('username') }),
action: this.props.onSuggestUser,
icon: require('@tabler/icons/icons/user-check.svg'),
});
if (features.suggestionsV2) {
if (account.getIn(['pleroma', 'is_suggested'])) {
menu.push({
text: intl.formatMessage(messages.unsuggestUser, { name: account.get('username') }),
action: this.props.onUnsuggestUser,
icon: require('@tabler/icons/icons/user-x.svg'),
});
} else {
menu.push({
text: intl.formatMessage(messages.suggestUser, { name: account.get('username') }),
action: this.props.onSuggestUser,
icon: require('@tabler/icons/icons/user-check.svg'),
});
}
}
if (account.get('id') !== me) {