mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-08 22:23:02 -04:00
Optimize slowest patches
This commit is contained in:
parent
1866e4d379
commit
8f59cd8a1a
14 changed files with 33 additions and 33 deletions
|
@ -89,8 +89,8 @@ export default definePlugin({
|
|||
},
|
||||
// Remove permission checking for getRenderLevel function
|
||||
{
|
||||
match: /(?<=getRenderLevel\(\i\){.+?return)!\i\.\i\.can\(\i\.\i\.VIEW_CHANNEL,this\.record\)\|\|/,
|
||||
replace: " "
|
||||
match: /(getRenderLevel\(\i\){.+?return)!\i\.\i\.can\(\i\.\i\.VIEW_CHANNEL,this\.record\)\|\|/,
|
||||
replace: (_, rest) => `${rest} `
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -159,8 +159,8 @@ export default definePlugin({
|
|||
replacement: [
|
||||
// Make the channel appear as muted if it's hidden
|
||||
{
|
||||
match: /(?<={channel:(\i),name:\i,muted:(\i).+?;)/,
|
||||
replace: (_, channel, muted) => `${muted}=$self.isHiddenChannel(${channel})?true:${muted};`
|
||||
match: /{channel:(\i),name:\i,muted:(\i).+?;/,
|
||||
replace: (m, channel, muted) => `${m}${muted}=$self.isHiddenChannel(${channel})?true:${muted};`
|
||||
},
|
||||
// Add the hidden eye icon if the channel is hidden
|
||||
{
|
||||
|
@ -186,8 +186,8 @@ export default definePlugin({
|
|||
{
|
||||
// Hide unreads
|
||||
predicate: () => settings.store.hideUnreads === true,
|
||||
match: /(?<={channel:(\i),name:\i,.+?unread:(\i).+?;)/,
|
||||
replace: (_, channel, unread) => `${unread}=$self.isHiddenChannel(${channel})?false:${unread};`
|
||||
match: /{channel:(\i),name:\i,.+?unread:(\i).+?;/,
|
||||
replace: (m, channel, unread) => `${m}${unread}=$self.isHiddenChannel(${channel})?false:${unread};`
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue