Fix Debug Logging toggle not working

Closes #3268
This commit is contained in:
Vendicated 2025-09-23 22:24:58 +02:00
parent 228b85a0c8
commit 746c824020
No known key found for this signature in database
GPG key ID: D66986BAF75ECF18
2 changed files with 11 additions and 1 deletions

View file

@ -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.

View file

@ -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 extends PluginDef>(p: P & Record<PropertyKey, any>) {
@ -151,7 +152,7 @@ export interface PluginDef {
* Allows you to subscribe to Flux events
*/
flux?: {
[E in FluxEvents]?: (event: any) => void | Promise<void>;
[E in LiteralUnion<FluxEvents, string>]?: (event: any) => void | Promise<void>;
};
/**
* Allows you to manipulate context menus