From 65069c673c4bc5a2c14bbba1792bf79a0861750b Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Sun, 22 Sep 2024 13:05:08 -0300 Subject: [PATCH] UserVoiceShow: Fix showing hidden channels --- src/plugins/userVoiceShow/components.tsx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/plugins/userVoiceShow/components.tsx b/src/plugins/userVoiceShow/components.tsx index f9a81c4b..c509f694 100644 --- a/src/plugins/userVoiceShow/components.tsx +++ b/src/plugins/userVoiceShow/components.tsx @@ -145,6 +145,8 @@ export const VoiceChannelIndicator = ErrorBoundary.wrap(({ userId, isMessageIndi if (channel == null) return null; const isDM = channel.isDM() || channel.isMultiUserDM(); + if (!isDM && !PermissionStore.can(PermissionsBits.VIEW_CHANNEL, channel) && !Vencord.Plugins.isPluginEnabled("ShowHiddenChannels")) return null; + const isLocked = !isDM && (!PermissionStore.can(PermissionsBits.VIEW_CHANNEL, channel) || !PermissionStore.can(PermissionsBits.CONNECT, channel)); function onClick(e: React.MouseEvent) { @@ -153,11 +155,6 @@ export const VoiceChannelIndicator = ErrorBoundary.wrap(({ userId, isMessageIndi if (channel == null || channelId == null) return; - if (!isDM && !PermissionStore.can(PermissionsBits.VIEW_CHANNEL, channel)) { - showToast("You cannot view the user's Voice Channel", Toasts.Type.FAILURE); - return; - } - clearTimeout(clickTimers[channelId]); delete clickTimers[channelId];