Skip to content

Commit

Permalink
fix(noDefaultHangStatus): properly extend type
Browse files Browse the repository at this point in the history
  • Loading branch information
D3SOX committed May 16, 2024
1 parent af6fac3 commit b09274a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions noDefaultHangStatus/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,22 @@ import { Devs } from "@utils/constants";
import definePlugin, { PluginDef } from "@utils/types";
import { FluxDispatcher } from "@webpack/common";

type MyPluginDef = PluginDef & {
flux: {
UPDATE_HANG_STATUS: ({ status, saveAsDefault }: { status: string, saveAsDefault?: boolean }) => void;
};
};

export default definePlugin({
name: "NoDefaultHangStatus",
description: "Disable the default hang status when joining voice channels",
authors: [Devs.D3SOX],

flux: {
UPDATE_HANG_STATUS: ({ status, saveAsDefault }: { status: string, saveAsDefault?: boolean }) => {
UPDATE_HANG_STATUS: ({ status, saveAsDefault }) => {
if (saveAsDefault === undefined && status) {
FluxDispatcher.dispatch({ type: "CLEAR_HANG_STATUS" });
}
},
}
// Hack to avoid having to extend the type here because I don't know how
} as PluginDef);
} as MyPluginDef);

0 comments on commit b09274a

Please sign in to comment.