Fix canary crashing (#1833)

This commit is contained in:
V 2023-10-25 00:17:11 +02:00 committed by GitHub
parent 4a2def03e7
commit 1a1d9b07e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 87 additions and 36 deletions

View file

@ -41,7 +41,7 @@ export default definePlugin({
find: "showCommunicationDisabledStyles",
replacement: {
match: /("span",{id:\i,className:\i,children:\i}\))/,
replace: "$1, $self.CompactPronounsChatComponentWrapper(e)"
replace: "$1, $self.CompactPronounsChatComponentWrapper(arguments[0])"
}
},
// Patch the chat timestamp element (normal mode)
@ -49,7 +49,7 @@ export default definePlugin({
find: "showCommunicationDisabledStyles",
replacement: {
match: /(?<=return\s*\(0,\i\.jsxs?\)\(.+!\i&&)(\(0,\i.jsxs?\)\(.+?\{.+?\}\))/,
replace: "[$1, $self.PronounsChatComponentWrapper(e)]"
replace: "[$1, $self.PronounsChatComponentWrapper(arguments[0])]"
}
},
// Patch the profile popout username header to use our pronoun hook instead of Discord's pronouns