29 lines
959 B
TypeScript
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;
|