Files
discord-decomp/modules/voice_panel/VoicePanelUtils.native.tsx
T
2026-11-01 12:12:55 +02:00

34 lines
1.5 KiB
TypeScript

// Metro module 10689 (f10690).
import ChannelStore from "../../stores/ChannelStore";
import RTCConnectionStore from "../../stores/RTCConnectionStore";
import VoicePanelStore from "./VoicePanelStore";
import * as _StageVoicePanelExperiment from "../stage_channels/StageVoicePanelExperiment";
import { useStateFromStores } from "../../_bundle/defaultAreStatesEqual";
export function isVoicePanelEnabled(a0) {
const isStageVoicePanelEnabled = _StageVoicePanelExperiment.isStageVoicePanelEnabled("voice_panel_utils");
return !(isStageVoicePanelEnabled ? !isStageVoicePanelEnabled : a0 == null ? void 0 : a0.isGuildStageVoice());
}
export function useIsVoicePanelShowing() {
return useStateFromStores([ChannelStore, RTCConnectionStore], () => {
const channel = ChannelStore.getChannel(RTCConnectionStore.getChannelId());
let r8 = channel != null;
if (r8) {
const isGuildStageVoice = channel.isGuildStageVoice();
r8 = isGuildStageVoice ? _StageVoicePanelExperiment.isStageVoicePanelEnabled("voice_panel_utils") : !isGuildStageVoice;
}
return r8;
});
}
export function useIsVoicePanelFullscreen() {
return VoicePanelStore((a0) => a0.isVoicePanelFullscreen());
}
export function useIsVoicePanelOpen(c18194_0) {
return VoicePanelStore((a0) => a0.isChannelOpen(c18194_0));
}
export function useIsAnyVoicePanelOpen() {
return VoicePanelStore((a0) => a0.isAnyVoicePanelOpen());
}
export function useIsVoicePanelMounted(c18195_0) {
return VoicePanelStore((a0) => a0.isMounted(c18195_0));
}