parent
228b85a0c8
commit
746c824020
2 changed files with 11 additions and 1 deletions
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue