VoiceMessages: Improve permission check (#1544)

Co-authored-by: V <vendicated@riseup.net>
This commit is contained in:
Hugo C 2023-08-02 02:27:10 +02:00 committed by GitHub
parent 2e002107a6
commit 645749b5ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -220,7 +220,7 @@ function Modal({ modalProps }: { modalProps: ModalProps; }) {
} }
const ctxMenuPatch: NavContextMenuPatchCallback = (children, props) => () => { const ctxMenuPatch: NavContextMenuPatchCallback = (children, props) => () => {
if (props.channel.guild_id && !PermissionStore.can(PermissionsBits.SEND_VOICE_MESSAGES, props.channel)) return; if (props.channel.guild_id && !(PermissionStore.can(PermissionsBits.SEND_VOICE_MESSAGES, props.channel) && PermissionStore.can(PermissionsBits.SEND_MESSAGES, props.channel))) return;
children.push( children.push(
<Menu.MenuItem <Menu.MenuItem