From e69236c5f83c935b8e00658928536cae380a8776 Mon Sep 17 00:00:00 2001 From: Nico Date: Wed, 25 Oct 2023 16:58:02 +0200 Subject: [PATCH] fix(vcDoubleClick): update for new discord build (#1862) --- src/plugins/vcDoubleClick/index.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/plugins/vcDoubleClick/index.ts b/src/plugins/vcDoubleClick/index.ts index 31543510e..a55ac7b67 100644 --- a/src/plugins/vcDoubleClick/index.ts +++ b/src/plugins/vcDoubleClick/index.ts @@ -30,20 +30,22 @@ export default definePlugin({ description: "Join voice chats via double click instead of single click", authors: [Devs.Ven, Devs.D3SOX], patches: [ - { - find: "VoiceChannel.renderPopout", + ...[ + ".handleVoiceStatusClick", // voice channels + ".handleClickChat" // stage channels + ].map(find => ({ + find, // hack: these are not React onClick, it is a custom prop handled by Discord // thus, replacing this with onDoubleClick won't work, and you also cannot check // e.detail since instead of the event they pass the channel. // do this timer workaround instead replacement: [ - // voice/stage channels { - match: /onClick:function\(\)\{(e\.handleClick.+?)}/g, - replace: "onClick:function(){$self.schedule(()=>{$1},e)}", + match: /onClick:\(\)=>\{this.handleClick\(\)/g, + replace: "onClick:()=>{$self.schedule(()=>{this.handleClick()},this)", }, - ], - }, + ] + })), { // channel mentions find: ".shouldCloseDefaultModals",