CtrlEnterSend: fix for new Discord update (#2689)

Co-authored-by: vee <vendicated@riseup.net>
This commit is contained in:
Ulysses Zhan 2024-07-12 12:27:28 -07:00 committed by GitHub
parent 04dce64bfd
commit 993304f96c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -39,6 +39,15 @@ export default definePlugin({
} }
}), }),
patches: [ patches: [
// Only one of the two patches will be at effect; Discord often updates to switch between them.
// See: https://discord.com/channels/1015060230222131221/1032770730703716362/1261398512017477673
{
find: ".ENTER&&(!",
replacement: {
match: /(?<=(\i)\.which===\i\.\i.ENTER&&).{0,100}(\(0,\i\.\i\)\(\i\)).{0,100}(?=&&\(\i\.preventDefault)/,
replace: "$self.shouldSubmit($1, $2)"
}
},
{ {
find: "!this.hasOpenCodeBlock()", find: "!this.hasOpenCodeBlock()",
replacement: { replacement: {