Fix BetterSettings patches (#2307)

main
Nuckyz 8 months ago
parent 2f07dc230a
commit 74c38146d5
No known key found for this signature in database
GPG Key ID: 440BF8296E1C4AD9

@ -82,7 +82,7 @@ export default definePlugin({
find: "this.renderArtisanalHack()", find: "this.renderArtisanalHack()",
replacement: [ replacement: [
{ // Fade in on layer { // Fade in on layer
match: /(?<=(\i)\.contextType=\i\.AccessibilityPreferencesContext;)/, match: /(?<=\((\i),"contextType",\i\.AccessibilityPreferencesContext\);)/,
replace: "$1=$self.Layer;", replace: "$1=$self.Layer;",
predicate: () => settings.store.disableFade predicate: () => settings.store.disableFade
}, },
@ -107,11 +107,11 @@ export default definePlugin({
], ],
predicate: () => settings.store.disableFade predicate: () => settings.store.disableFade
}, },
{ // Load menu stuff on hover, not on click { // Load menu TOC eagerly
find: "Messages.USER_SETTINGS_WITH_BUILD_OVERRIDE.format", find: "Messages.USER_SETTINGS_WITH_BUILD_OVERRIDE.format",
replacement: { replacement: {
match: /(?<=handleOpenSettingsContextMenu.{0,250}?\i\.el\(("[^"]+")\)\.then\([^;]*?("\d+").*?Messages\.USER_SETTINGS,)(?=onClick:)/, match: /(?<=(\i)\(this,"handleOpenSettingsContextMenu",.{0,100}?openContextMenuLazy.{0,100}?(await Promise\.all[^};]*?\)\)).*?,)(?=\1\(this)/,
replace: "onMouseEnter(){Vencord.Webpack.wreq.el($1).then(()=>Vencord.Webpack.wreq($2));}," replace: "(async ()=>$2)(),"
}, },
predicate: () => settings.store.eagerLoad predicate: () => settings.store.eagerLoad
}, },

Loading…
Cancel
Save