Fix SHC patches

This commit is contained in:
Nuckyz 2023-11-15 14:50:52 -03:00
parent fd25b5f296
commit 7b248ee309
No known key found for this signature in database
GPG key ID: 440BF8296E1C4AD9

View file

@ -68,7 +68,7 @@ export default definePlugin({
patches: [ patches: [
{ {
// RenderLevel defines if a channel is hidden, collapsed in category, visible, etc // RenderLevel defines if a channel is hidden, collapsed in category, visible, etc
find: ".CannotShow=", find: '"placeholder-channel-id"',
replacement: [ replacement: [
// Remove the special logic for channels we don't have access to // Remove the special logic for channels we don't have access to
{ {
@ -82,13 +82,8 @@ export default definePlugin({
}, },
// Make channels we dont have access to be the same level as normal ones // Make channels we dont have access to be the same level as normal ones
{ {
match: /(?<=renderLevel:(\i\(this,\i\)\?\i\.Show:\i\.WouldShowIfUncollapsed).+?renderLevel:).+?(?=,)/, match: /(activeJoinedRelevantThreads:.{0,50}VIEW_CHANNEL.+?renderLevel:(.+?),threadIds.+?renderLevel:).+?(?=,threadIds)/g,
replace: (_, renderLevelExpression) => renderLevelExpression replace: (_, rest, defaultRenderLevel) => `${rest}${defaultRenderLevel}`
},
// 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 // Remove permission checking for getRenderLevel function
{ {