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

29 lines
959 B
TypeScript

// Metro module 16640 (f16641).
import RTCConnectionStore from "../../stores/RTCConnectionStore";
import VoicePanelStore from "./VoicePanelStore";
import AutomaticLifecycleManager from "../../lib/AutomaticLifecycleManager";
class VoicePanelManager extends AutomaticLifecycleManager {
actions = {
VOICE_CHANNEL_SELECT: () => {
const channelId = RTCConnectionStore.getChannelId();
if (channelId != null) {
const state = VoicePanelStore.getState();
if (!state.channels.has(channelId)) {
state.openChannel(channelId);
}
}
},
RTC_CONNECTION_STATE: () => {
const channelId = RTCConnectionStore.getChannelId();
if (channelId != null) {
const state = VoicePanelStore.getState();
if (!state.channels.has(channelId)) {
state.openChannel(channelId);
}
}
}
};
}
const voicePanelManager = new VoicePanelManager();
export default voicePanelManager;