diff options
author | Nico <nico@d3sox.me> | 2023-01-13 23:18:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-13 23:18:12 +0100 |
commit | 32cdb6388527c109945c69b4c9edff42033e8a93 (patch) | |
tree | 0b8db77fa310ace3dbfd76f132c9ce5fde626009 | |
parent | ea748dfb605386b80a4919183ad6fa9249a82e21 (diff) | |
download | Vencord-32cdb6388527c109945c69b4c9edff42033e8a93.tar.gz Vencord-32cdb6388527c109945c69b4c9edff42033e8a93.tar.bz2 Vencord-32cdb6388527c109945c69b4c9edff42033e8a93.zip |
fix(vcDoubleClick): fix functionality (#410)
Co-authored-by: Ven <vendicated@riseup.net>
-rw-r--r-- | src/plugins/forceOwnerCrown.ts | 5 | ||||
-rw-r--r-- | src/plugins/vcDoubleClick.ts | 15 |
2 files changed, 6 insertions, 14 deletions
diff --git a/src/plugins/forceOwnerCrown.ts b/src/plugins/forceOwnerCrown.ts index 9345ea7..0c1df47 100644 --- a/src/plugins/forceOwnerCrown.ts +++ b/src/plugins/forceOwnerCrown.ts @@ -18,10 +18,7 @@ import { Devs } from "@utils/constants"; import definePlugin from "@utils/types"; -import { waitFor } from "@webpack"; - -let GuildStore; -waitFor(["getGuild"], m => GuildStore = m); +import { GuildStore } from "@webpack/common"; export default definePlugin({ name: "ForceOwnerCrown", diff --git a/src/plugins/vcDoubleClick.ts b/src/plugins/vcDoubleClick.ts index de573f1..1985107 100644 --- a/src/plugins/vcDoubleClick.ts +++ b/src/plugins/vcDoubleClick.ts @@ -39,19 +39,15 @@ export default definePlugin({ // e.detail since instead of the event they pass the channel. // do this timer workaround instead replacement: [ - // voice channels + // voice/stage channels { - match: /onClick:(.*)function\(\)\{(e\.handleClick.+?)}/g, - replace: "onClick:$1function(){Vencord.Plugins.plugins.VoiceChatDoubleClick.schedule(()=>{$2}, e)}", + match: /onClick:function\(\)\{(e\.handleClick.+?)}/g, + replace: "onClick:function(){Vencord.Plugins.plugins.VoiceChatDoubleClick.schedule(()=>{$1},e)}", }, - // stage channels - { - match: /onClick:(.{0,15})this\.handleClick,/g, - replace: "onClick:$1(...args)=>Vencord.Plugins.plugins.VoiceChatDoubleClick.schedule(()=>{this.handleClick(...args);}, args[0]),", - } ], }, { + // channel mentions find: 'className:"channelMention",iconType:(', replacement: { match: /onClick:(.{1,3}),/, @@ -61,8 +57,7 @@ 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; + const id = e.props.channel.id as string; if (SelectedChannelStore.getVoiceChannelId() === id) { cb(); return; |