decord/source/modules/voice_panel/VoicePanelUtils.native.tsx

60 lines
2.4 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 8704
// Function ID: 8705
2026-07-20 16:05:17 +00:00
// Name: isVoicePanelEnabled
2026-08-24 06:08:38 +00:00
// Dependencies: [1391, 4544, 8701, 8702, 647, 2]
2026-07-20 16:05:17 +00:00
// Exports: isVoicePanelEnabled, useIsAnyVoicePanelOpen, useIsVoicePanelFullscreen, useIsVoicePanelMounted, useIsVoicePanelOpen, useIsVoicePanelShowing
2026-08-24 06:08:38 +00:00
// Module 8704 (isVoicePanelEnabled)
import defaultAreStatesEqual from "defaultAreStatesEqual" /* 647 */;
import useIsStageVoicePanelEnabled from "useIsStageVoicePanelEnabled" /* 8702 */;
import closure_2 from "ensureGuildLoaded" /* 1391 */;
import closure_3 from "createRTCConnection" /* 4544 */;
import closure_4 from "withEqualityFn" /* 8701 */;
2026-07-20 16:05:17 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
let result = require("set").fileFinishedImporting("modules/voice_panel/VoicePanelUtils.native.tsx");
2026-07-20 16:05:17 +00:00
export const isVoicePanelEnabled = function isVoicePanelEnabled(channel2) {
2026-08-24 06:08:38 +00:00
const result = useIsStageVoicePanelEnabled.isStageVoicePanelEnabled("voice_panel_utils");
2026-07-29 08:29:29 +00:00
let tmp2 = !result;
if (!result) {
2026-07-20 16:05:17 +00:00
let isGuildStageVoiceResult;
2026-07-29 08:29:29 +00:00
if (channel2 != null) {
2026-07-20 16:05:17 +00:00
isGuildStageVoiceResult = channel2.isGuildStageVoice();
}
2026-07-29 08:29:29 +00:00
tmp2 = isGuildStageVoiceResult;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return !tmp2;
2026-07-20 16:05:17 +00:00
};
export const useIsVoicePanelShowing = function useIsVoicePanelShowing() {
2026-08-24 06:08:38 +00:00
const items = [closure_2, closure_3];
return defaultAreStatesEqual.useStateFromStores(items, () => {
2026-07-29 08:29:29 +00:00
channel = channel.getChannel(channelId.getChannelId());
2026-07-20 16:05:17 +00:00
let tmp = null != channel;
if (tmp) {
2026-07-29 08:29:29 +00:00
const isGuildStageVoiceResult = channel.isGuildStageVoice();
let result = !isGuildStageVoiceResult;
if (isGuildStageVoiceResult) {
result = callback(table[3]).isStageVoicePanelEnabled("voice_panel_utils");
const obj2 = callback(table[3]);
2026-07-20 16:05:17 +00:00
}
tmp = result;
}
return tmp;
});
};
export const useIsVoicePanelFullscreen = function useIsVoicePanelFullscreen() {
return callback((isVoicePanelFullscreen) => isVoicePanelFullscreen.isVoicePanelFullscreen());
};
export const useIsVoicePanelOpen = function useIsVoicePanelOpen(channelId) {
2026-08-24 06:08:38 +00:00
closure_0 = channelId;
2026-07-23 10:11:24 +00:00
return callback((isChannelOpen) => isChannelOpen.isChannelOpen(closure_0));
2026-07-20 16:05:17 +00:00
};
export const useIsAnyVoicePanelOpen = function useIsAnyVoicePanelOpen() {
return callback((isAnyVoicePanelOpen) => isAnyVoicePanelOpen.isAnyVoicePanelOpen());
};
export const useIsVoicePanelMounted = function useIsVoicePanelMounted(channelId) {
2026-08-24 06:08:38 +00:00
closure_0 = channelId;
2026-07-23 10:11:24 +00:00
return callback((isMounted) => isMounted.isMounted(closure_0));
2026-07-20 16:05:17 +00:00
};