From 993304f96ccce375c2b0a15b102184e1449264b6 Mon Sep 17 00:00:00 2001 From: Ulysses Zhan Date: Fri, 12 Jul 2024 12:27:28 -0700 Subject: [PATCH 1/2] CtrlEnterSend: fix for new Discord update (#2689) Co-authored-by: vee --- src/plugins/ctrlEnterSend/index.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/plugins/ctrlEnterSend/index.ts b/src/plugins/ctrlEnterSend/index.ts index 6c9b7ac1d..4a1b73765 100644 --- a/src/plugins/ctrlEnterSend/index.ts +++ b/src/plugins/ctrlEnterSend/index.ts @@ -39,6 +39,15 @@ export default definePlugin({ } }), 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()", replacement: { From 0057ab42e8e11f79589c9d17c24dddcafef18272 Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Fri, 12 Jul 2024 16:40:26 -0300 Subject: [PATCH 2/2] Fix broken experiments patch --- src/plugins/experiments/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/experiments/index.tsx b/src/plugins/experiments/index.tsx index 4cf8439bc..33c32b1a0 100644 --- a/src/plugins/experiments/index.tsx +++ b/src/plugins/experiments/index.tsx @@ -88,8 +88,8 @@ export default definePlugin({ { find: "useCanFavoriteChannel", replacement: { - match: /!\(\i\.isDM\(\)\|\|\i\.isThread\(\)\)/, - replace: "true", + match: /\i\.isDM\(\)\|\|\i\.isThread\(\)/, + replace: "false", } } ],