aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNico <nico@d3sox.me>2022-10-30 18:47:12 +0100
committerGitHub <noreply@github.com>2022-10-30 18:47:12 +0100
commita43a41f61f4d4648d5464476811d82be3dcdf439 (patch)
tree2b220c7d2f91c781c1e1deab080d02303900c08a
parent3af9a14a0e78be88c5a048b79187c32796c06a7c (diff)
downloadVencord-a43a41f61f4d4648d5464476811d82be3dcdf439.tar.gz
Vencord-a43a41f61f4d4648d5464476811d82be3dcdf439.tar.bz2
Vencord-a43a41f61f4d4648d5464476811d82be3dcdf439.zip
vcDoubleClick: don't require dbl click on active vc, fix stage channels (#172)
-rw-r--r--src/plugins/vcDoubleClick.ts9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/plugins/vcDoubleClick.ts b/src/plugins/vcDoubleClick.ts
index 9c9503d..554b31a 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 Record<string, {
timeout?: NodeJS.Timeout;
@@ -46,8 +47,8 @@ export default definePlugin({
},
// stage channels
{
- match: /onClick:(\w+)\?void 0:this\.handleClick,/g,
- replace: "onClick:$1?void 0:(...args)=>Vencord.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