Skip to content

Commit

Permalink
Disable suspend button on user menu if user is moderator
Browse files Browse the repository at this point in the history
  • Loading branch information
atsu1125 authored and fs5m8 committed Jan 2, 2023
1 parent 7498f77 commit 3ca49f3
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/client/app/common/views/components/user-menu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,18 @@ export default Vue.extend({
action: this.updateRemoteUser,
});
}
menu = menu.concat([{
menu = menu.concat({
icon: faMicrophoneSlash,
text: this.user.isSilenced ? this.$t('unsilence') : this.$t('silence'),
action: this.toggleSilence
}, {
icon: faSnowflake,
text: this.user.isSuspended ? this.$t('unsuspend') : this.$t('suspend'),
action: this.toggleSuspend
}]);
});
if ((!this.user.isAdmin && !this.user.isModerator) || (this.user.isAdmin && this.user.isModerator && this.user.isSuspended)) {
menu = menu.concat({
icon: faSnowflake,
text: this.user.isSuspended ? this.$t('unsuspend') : this.$t('suspend'),
action: this.toggleSuspend
});
}
}
return {
Expand Down

0 comments on commit 3ca49f3

Please sign in to comment.