diff --git a/src/plugins/_core/noTrack.ts b/src/plugins/_core/noTrack.ts index ad1f255b..eada58cb 100644 --- a/src/plugins/_core/noTrack.ts +++ b/src/plugins/_core/noTrack.ts @@ -71,6 +71,15 @@ export default definePlugin({ } ], + // The TRACK event takes an optional `resolve` property that is called when the tracking event was submitted to the server. + // A few spots in Discord await this callback before continuing (most notably the Voice Debug Logging toggle). + // Since we NOOP the AnalyticsActionHandlers module, there is no handler for the TRACK event, so we have to handle it ourselves + flux: { + TRACK(event) { + event?.resolve?.(); + } + }, + startAt: StartAt.Init, start() { // Sentry is initialized in its own WebpackInstance. diff --git a/src/utils/types.ts b/src/utils/types.ts index 2f1d6396..2293b2ff 100644 --- a/src/utils/types.ts +++ b/src/utils/types.ts @@ -26,6 +26,7 @@ import { MessageClickListener, MessageEditListener, MessageSendListener } from " import { MessagePopoverButtonFactory } from "@api/MessagePopover"; import { Command, FluxEvents } from "@vencord/discord-types"; import { ReactNode } from "react"; +import { LiteralUnion } from "type-fest"; // exists to export default definePlugin({...}) export default function definePlugin
(p: P & Record