decord/stable/source/modules/calls/toggleVoiceChannelChat.tsx
2026-10-06 22:12:49 +00:00

40 lines
1.3 KiB
TypeScript

// Module ID: 14076
// Function ID: 14077
// Name: toggleVoiceChannelChat
// Dependencies: [2051, 4860, 4853, 5038, 2]
// Exports: toggleVoiceChannelChat
// Module 14076 (toggleVoiceChannelChat)
import ChannelRTCActionCreatorsDefault from "ChannelRTCActionCreators" /* 5038 */;
import ChannelStore from "ChannelStore" /* 2051 */;
import RTCConnectionStore from "RTCConnectionStore" /* 4860 */;
import ChannelRTCStore from "ChannelRTCStore" /* 4853 */;
import size from "module_2" /* 2 */;
const result = size.fileFinishedImporting("modules/calls/toggleVoiceChannelChat.tsx");
export const toggleVoiceChannelChat = function toggleVoiceChannelChat(open) {
const obj = RTCConnectionStore;
if (RTCConnectionStore.isConnected()) {
const channelId = obj.getChannelId();
if (null == channelId) {
return null;
} else {
const channel = ChannelStore.getChannel(channelId);
if (null != channel) {
if (channel.isGuildVoice()) {
let tmp3 = open;
if (open == null) {
tmp3 = !ChannelRTCStore.getChatOpen(channelId);
}
const obj3 = ChannelRTCActionCreatorsDefault;
obj3.updateChatOpen(channelId, tmp3);
return { channelId, chatOpen: tmp3 };
}
}
return null;
}
} else {
return null;
}
};