Skip to content

Commit

Permalink
refactor(noDefaultHangStatus): patch function instead to not send event
Browse files Browse the repository at this point in the history
  • Loading branch information
D3SOX committed May 16, 2024
1 parent 3007aad commit 88d256b
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions noDefaultHangStatus/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,19 @@

import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
import { FluxDispatcher } from "@webpack/common";

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

flux: {
UPDATE_HANG_STATUS: ({ status, saveAsDefault }) => {
if (saveAsDefault === undefined && status) {
// @ts-ignore
FluxDispatcher.dispatch({ type: "CLEAR_HANG_STATUS" });
patches: [
{
find: "updateHangStatus:function",
replacement: {
match: /(?<=function \i\((\i),(\i)\)\{var \i;)if\(null==\i\)/,
replace: "if(null==$1||$2===undefined)"
}
},
}
}
]
});

0 comments on commit 88d256b

Please sign in to comment.