From a43a41f61f4d4648d5464476811d82be3dcdf439 Mon Sep 17 00:00:00 2001 From: Nico Date: Sun, 30 Oct 2022 18:47:12 +0100 Subject: [PATCH] vcDoubleClick: don't require dbl click on active vc, fix stage channels (#172) --- src/plugins/vcDoubleClick.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/plugins/vcDoubleClick.ts b/src/plugins/vcDoubleClick.ts index 9c9503d37..554b31a25 100644 --- a/src/plugins/vcDoubleClick.ts +++ b/src/plugins/vcDoubleClick.ts @@ -18,6 +18,7 @@ import { Devs } from "../utils/constants"; import definePlugin from "../utils/types"; +import { SelectedChannelStore } from "../webpack/common"; const timers = {} as RecordVencord.Plugins.plugins.vcDoubleClick.schedule(()=>{this.handleClick(...args);}, args[0]),", + match: /onClick:(.{0,15})this\.handleClick,/g, + replace: "onClick:$1(...args)=>Vencord.Plugins.plugins.vcDoubleClick.schedule(()=>{this.handleClick(...args);}, args[0]),", } ], }, @@ -63,6 +64,10 @@ export default definePlugin({ schedule(cb: () => void, e: any) { // support from stage and voice channels patch const id = e?.id ?? e.props.channel.id as string; + if (SelectedChannelStore.getVoiceChannelId() === id) { + cb(); + return; + } // use a different counter for each channel const data = (timers[id] ??= { timeout: void 0, i: 0 }); // clear any existing timer