ignoreCalls fix Ignore Button (#824)
* ignoreCalls fix Button * fix(ignoreCalls): include ongoingRings in ignore dispatch * Update index.tsx * nvm * fix(ignoreCalls): use object default for ongoingRings * Update index.tsx * Update index.tsx * Update index.tsx --------- Co-authored-by: thororen1234 <78185467+thororen1234@users.noreply.github.com>
This commit is contained in:
parent
91e0401ea8
commit
a8109fbfce
1 changed files with 19 additions and 8 deletions
|
|
@ -17,6 +17,20 @@ import { Channel } from "@vencord/discord-types";
|
|||
import { findComponentByCodeLazy } from "@webpack";
|
||||
import { FluxDispatcher, Menu, React, Tooltip, UserStore } from "@webpack/common";
|
||||
|
||||
interface CallUpdate {
|
||||
ringing: string[];
|
||||
ongoingRings: Record<number, string>;
|
||||
messageId: string;
|
||||
region: string;
|
||||
}
|
||||
|
||||
const args: CallUpdate = {
|
||||
ringing: [],
|
||||
ongoingRings: {},
|
||||
messageId: "",
|
||||
region: "",
|
||||
};
|
||||
|
||||
const ignoredChannelIds = new Set<string>();
|
||||
const cl = classNameFactory("vc-ignore-calls-");
|
||||
const Deafen = findComponentByCodeLazy("0-1.02-.1H3.05a9");
|
||||
|
|
@ -74,12 +88,6 @@ const settings = definePluginSettings({
|
|||
},
|
||||
});
|
||||
|
||||
const args = {
|
||||
ringing: [],
|
||||
messageId: "",
|
||||
region: "",
|
||||
};
|
||||
|
||||
export default definePlugin({
|
||||
name: "IgnoreCalls",
|
||||
description: "Allows you to ignore calls from specific users or dm groups.",
|
||||
|
|
@ -99,8 +107,9 @@ export default definePlugin({
|
|||
"gdm-context": ContextMenuPatch,
|
||||
},
|
||||
flux: {
|
||||
async CALL_UPDATE({ ringing, messageId, region }) {
|
||||
args.ringing = ringing;
|
||||
async CALL_UPDATE({ ringing, ongoingRings, messageId, region }) {
|
||||
args.ringing = ringing || [];
|
||||
args.ongoingRings = ongoingRings || {};
|
||||
args.messageId = messageId;
|
||||
args.region = region;
|
||||
}
|
||||
|
|
@ -113,6 +122,7 @@ export default definePlugin({
|
|||
type: "CALL_UPDATE",
|
||||
channelId: channel.id,
|
||||
ringing: args.ringing.filter((id: string) => id !== currentUserId),
|
||||
ongoingRings: args.ongoingRings,
|
||||
messageId: args.messageId,
|
||||
region: args.region
|
||||
});
|
||||
|
|
@ -133,6 +143,7 @@ export default definePlugin({
|
|||
type: "CALL_UPDATE",
|
||||
channelId: channel.id,
|
||||
ringing: args.ringing.filter((id: string) => id !== currentUserId),
|
||||
ongoingRings: args.ongoingRings,
|
||||
messageId: args.messageId,
|
||||
region: args.region
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue