diff --git a/src/plugins/showHiddenChannels/index.tsx b/src/plugins/showHiddenChannels/index.tsx index e3e3b75643..5259ce092f 100644 --- a/src/plugins/showHiddenChannels/index.tsx +++ b/src/plugins/showHiddenChannels/index.tsx @@ -25,7 +25,7 @@ import { canonicalizeMatch } from "@utils/patches"; import definePlugin, { OptionType, type Patch } from "@utils/types"; import type { ChannelRecord, GuildCategoryChannelRecord, GuildChannel, GuildChannelRecord, Role } from "@vencord/discord-types"; import { findByPropsLazy } from "@webpack"; -import { Permissions, PermissionStore, Tooltip } from "@webpack/common"; +import { ChannelStore, Permissions, PermissionStore, Tooltip } from "@webpack/common"; import HiddenChannelLockScreen from "./components/HiddenChannelLockScreen"; @@ -476,8 +476,13 @@ export default definePlugin({ } ], - isHiddenChannel(channel?: ChannelRecord, checkConnect = false) { - if (!channel || channel.isPrivate()) return false; + isHiddenChannel(channel?: ChannelRecord | { channelId: string; }, checkConnect = false) { + if (!channel) return false; + + if (!("isPrivate" in channel)) { + channel = ChannelStore.getChannel(channel.channelId); + if (!channel || !channel.isPrivate()) return false; + } return !PermissionStore.can(Permissions.VIEW_CHANNEL, channel) || checkConnect && !PermissionStore.can(Permissions.CONNECT, channel);