decord/beta/source/modules/calls/toggleVoiceChannelChat.tsx
2026-10-01 14:13:23 +00:00

40 lines
1.3 KiB
TypeScript

// Module ID: 14074
// Function ID: 14075
// Name: toggleVoiceChannelChat
// Dependencies: [2045, 4859, 4852, 5037, 2]
// Exports: toggleVoiceChannelChat
// Module 14074 (toggleVoiceChannelChat)
import ChannelRTCActionCreatorsDefault from "ChannelRTCActionCreators" /* 5037 */;
import ChannelStore from "ChannelStore" /* 2045 */;
import RTCConnectionStore from "RTCConnectionStore" /* 4859 */;
import ChannelRTCStore from "ChannelRTCStore" /* 4852 */;
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;
}
};