decord/beta/source/modules/voice_panel/VoicePanelManager.native.tsx
2026-10-07 22:43:51 +00:00

62 lines
2.2 KiB
TypeScript

// Module ID: 17996
// Function ID: 17997
// Name: VoicePanelManager
// Dependencies: [2051, 4913, 5098, 6613, 2]
// Module 17996 (VoicePanelManager)
import ChannelStore from "ChannelStore" /* 2051 */;
import RTCConnectionStore from "RTCConnectionStore" /* 4913 */;
import VoicePanelStore from "VoicePanelStore" /* 5098 */;
import AutomaticLifecycleManager from "AutomaticLifecycleManager" /* 6613 */;
import size from "module_2" /* 2 */;
class VoicePanelManager extends AutomaticLifecycleManager {
constructor() {
const applyArgumentsResult = HermesBuiltin.applyArguments(this, new.target);
applyArgumentsResult.actions = {
VOICE_CHANNEL_SELECT() {
const channelId = RTCConnectionStore.getChannelId();
if (null != channelId) {
const state = VoicePanelStore.getState();
const channel = ChannelStore.getChannel(channelId);
let isGuildStageVoiceResult;
if (channel != null) {
isGuildStageVoiceResult = channel.isGuildStageVoice();
}
if (isGuildStageVoiceResult) {
state.closeChannel(channelId);
} else {
const channels = state.channels;
if (!channels.has(channelId)) {
state.openChannel(channelId);
}
}
}
},
RTC_CONNECTION_STATE() {
const channelId = RTCConnectionStore.getChannelId();
if (null != channelId) {
const state = VoicePanelStore.getState();
const channel = ChannelStore.getChannel(channelId);
let isGuildStageVoiceResult;
if (channel != null) {
isGuildStageVoiceResult = channel.isGuildStageVoice();
}
if (isGuildStageVoiceResult) {
state.closeChannel(channelId);
} else {
const channels = state.channels;
if (!channels.has(channelId)) {
state.openChannel(channelId);
}
}
}
}
};
return applyArgumentsResult;
}
}
const voicePanelManager = new VoicePanelManager();
const result = size.fileFinishedImporting("modules/voice_panel/VoicePanelManager.native.tsx");
export default voicePanelManager;