From 8692109bc5bd2ded817bbbfcef937a1d036cc2a8 Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Thu, 26 Oct 2023 18:13:25 -0300 Subject: [PATCH] Add comments to some SHC patches --- src/plugins/showHiddenChannels/index.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/plugins/showHiddenChannels/index.tsx b/src/plugins/showHiddenChannels/index.tsx index 52494210..9a7f1e63 100644 --- a/src/plugins/showHiddenChannels/index.tsx +++ b/src/plugins/showHiddenChannels/index.tsx @@ -70,22 +70,27 @@ export default definePlugin({ // RenderLevel defines if a channel is hidden, collapsed in category, visible, etc find: ".CannotShow=", replacement: [ + // Remove the special logic for channels we don't have access to { match: /if\(!\i\.\i\.can\(\i\.\i\.VIEW_CHANNEL.+?{if\(this\.id===\i\).+?threadIds:\i}}/, replace: "" }, + // Do not check for unreads when selecting the render level if the channel is hidden { match: /(?=!1===\i.\i\.hasRelevantUnread\(this\.record\))/, replace: "$self.isHiddenChannel(this.record)||" }, + // Make channels we dont have access to be the same level as normal ones { match: /(?<=renderLevel:(\i\(this,\i\)\?\i\.Show:\i\.WouldShowIfUncollapsed).+?renderLevel:).+?(?=,)/, replace: (_, renderLevelExpression) => renderLevelExpression }, + // Make channels we dont have access to be the same level as normal ones { match: /(?<=activeJoinedRelevantThreads.+?renderLevel:.+?,threadIds:\i\(this.record.+?renderLevel:)(\i)\..+?(?=,)/, replace: (_, RenderLevels) => `${RenderLevels}.Show` }, + // Remove permission checking for getRenderLevel function { match: /(?<=getRenderLevel\(\i\){.+?return)!\i\.\i\.can\(\i\.\i\.VIEW_CHANNEL,this\.record\)\|\|/, replace: " "