decord/stable/source/modules/voice_panel/VoicePanelManager.native.tsx

63 lines
2.2 KiB
TypeScript
Raw Permalink Normal View History

2026-10-06 22:12:49 +00:00
// Module ID: 17631
// Function ID: 17632
// Name: VoicePanelManager
2026-10-06 22:12:49 +00:00
// Dependencies: [2051, 4860, 5045, 6540, 2]
2026-10-06 22:12:49 +00:00
// Module 17631 (VoicePanelManager)
import ChannelStore from "ChannelStore" /* 2051 */;
import RTCConnectionStore from "RTCConnectionStore" /* 4860 */;
import VoicePanelStore from "VoicePanelStore" /* 5045 */;
import AutomaticLifecycleManager from "AutomaticLifecycleManager" /* 6540 */;
import size from "module_2" /* 2 */;
2026-10-06 22:12:49 +00:00
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);
}
}
}
2026-10-06 22:12:49 +00:00
},
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);
}
}
}
}
2026-10-06 22:12:49 +00:00
};
return applyArgumentsResult;
}
}
2026-10-06 22:12:49 +00:00
const voicePanelManager = new VoicePanelManager();
const result = size.fileFinishedImporting("modules/voice_panel/VoicePanelManager.native.tsx");
2026-10-06 22:12:49 +00:00
export default voicePanelManager;