diff options
author | Vendicated <vendicated@riseup.net> | 2022-09-27 14:34:57 +0200 |
---|---|---|
committer | Vendicated <vendicated@riseup.net> | 2022-09-27 14:34:57 +0200 |
commit | 6398dd25d20e6bc3e02425b709233066baf64e0c (patch) | |
tree | 3502593fdb4912c678ce6e840726114ccdb8c218 /src/plugins/settings.ts | |
parent | d0940a8b194805173dae029d0fe284974ffecc7a (diff) | |
download | Vencord-6398dd25d20e6bc3e02425b709233066baf64e0c.tar.gz Vencord-6398dd25d20e6bc3e02425b709233066baf64e0c.tar.bz2 Vencord-6398dd25d20e6bc3e02425b709233066baf64e0c.zip |
Unbrick Vencord - Pt 1
Diffstat (limited to 'src/plugins/settings.ts')
-rw-r--r-- | src/plugins/settings.ts | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/src/plugins/settings.ts b/src/plugins/settings.ts index 7d6af2d..1281f4e 100644 --- a/src/plugins/settings.ts +++ b/src/plugins/settings.ts @@ -7,33 +7,27 @@ export default definePlugin({ author: "Vendicated", required: true, patches: [{ - find: "default.versionHash", + find: "().versionHash", replacement: [ { - match: /return .{1,2}\("div"/, - replace: (m) => { - return `var versions=VencordNative.getVersions();${m}`; - } - }, - { - match: /\w\.createElement.+?["']Host ["'].+?\):null/, + match: /\w\.createElement\(.{1,2}.Fragment,.{0,30}\{[^}]+\},"Host ".+?\):null/, replace: m => { const idx = m.indexOf("Host") - 1; const template = m.slice(0, idx); return `${m}, ${template}"Vencord ", "${gitHash}"), " "), ` + - `${template} "Electron ", versions.electron), " "), ` + - `${template} "Chrome ", versions.chrome), " ")`; + `${template} "Electron ",VencordNative.getVersions().electron)," "), ` + + `${template} "Chrome ",VencordNative.getVersions().chrome)," ")`; } } ] }, { find: "Messages.ACTIVITY_SETTINGS", replacement: { - match: /\{section:(.{1,2})\.SectionTypes\.HEADER,\s*label:(.{1,2})\.default\.Messages\.ACTIVITY_SETTINGS\}/, + match: /\{section:(.{1,2})\.ID\.HEADER,\s*label:(.{1,2})\..{1,2}\.Messages\.ACTIVITY_SETTINGS\}/, replace: (m, mod) => - `{section:${mod}.SectionTypes.HEADER,label:"Vencord"},` + + `{section:${mod}.ID.HEADER,label:"Vencord"},` + `{section:"Vencord",label:"Vencord",element:Vencord.Components.Settings},` + - `{section:${mod}.SectionTypes.DIVIDER},${m}` + `{section:${mod}.ID.DIVIDER},${m}` } }] |