ShowHiddenChannels: Fix incorrect allowed users and roles component

This commit is contained in:
Nuckyz 2025-08-07 09:29:33 -03:00
parent 98efe13b97
commit c7e799e935
No known key found for this signature in database
GPG key ID: 440BF8296E1C4AD9

View file

@ -301,8 +301,8 @@ export default definePlugin({
},
{
// Patch the header to only return allowed users and roles if it's a hidden channel or locked channel (Like when it's used on the HiddenChannelLockScreen)
match: /\.members.+?\]}\),(?<=channel:(\i).+?)/,
replace: (m, channel) => `${m}$self.isHiddenChannel(${channel},true)?null:`
match: /return\(0,\i\.jsxs?\)\(\i\.\i,{channelId:(\i)\.id(?=.+?(\(0,\i\.jsxs?\)\("div",{className:\i\.members.+?\]}\)),)/,
replace: (m, channel, allowedUsersAndRolesComponent) => `if($self.isHiddenChannel(${channel},true)){return${allowedUsersAndRolesComponent};}${m}`
},
{
// Export the channel for the users allowed component patch