Files
discord-decomp/modules/video_calls/useDeafStates.tsx
T
2026-11-01 12:12:55 +02:00

36 lines
1.2 KiB
TypeScript

// Metro module 10812 (f10813).
import AuthenticationStore from "../../stores/AuthenticationStore";
import MediaEngineStore from "../../stores/MediaEngineStore";
import VoiceStateStore from "../../stores/VoiceStateStore";
import { useStateFromStoresObject } from "../../_bundle/Module589";
export default function useDeafStates(a0) {
return useStateFromStoresObject([VoiceStateStore, MediaEngineStore, AuthenticationStore], () => {
if (VoiceStateStore !== void 0 && MediaEngineStore !== void 0 && AuthenticationStore !== void 0) {
const r4 = a0 != null ? VoiceStateStore.getVoiceState(a0.getGuildId(), AuthenticationStore.getId()) : null;
const r17 = {
selfDeaf: MediaEngineStore.isSelfDeaf(),
deaf: null
};
let deaf = r4?.deaf;
if (deaf == null) {
deaf = false;
}
r17.deaf = deaf;
return r17;
}
}, [a0]);
};
export function getDeafStates(a0, r8 = VoiceStateStore, r6 = MediaEngineStore, r9 = AuthenticationStore) {
const r4 = a0 != null ? r8.getVoiceState(a0.getGuildId(), r9.getId()) : null;
const r16 = {
selfDeaf: r6.isSelfDeaf(),
deaf: null
};
let deaf = r4?.deaf;
if (deaf == null) {
deaf = false;
}
r16.deaf = deaf;
return r16;
}