decord/source/modules/calls/mobile/useIsCallActive.tsx
2026-08-25 06:04:03 +00:00

54 lines
2 KiB
TypeScript

// Module ID: 8241
// Function ID: 8242
// Name: useIsCallActive
// Dependencies: [5103, 4396, 4401, 589, 2]
// Exports: checkIsCallActive, default, useIsCallActiveNullable
// Module 8241 (useIsCallActive)
import closure_2 from "callConnect" /* 5103 */;
import closure_3 from "getParticipants" /* 4396 */;
import { ParticipantTypes } from "ParticipantTypes" /* 4401 */;
const require = arg1;
const result = require("set").fileFinishedImporting("modules/calls/mobile/useIsCallActive.tsx");
export default function useIsCallActive(arg0, arg1) {
const _require = arg0;
dependencyMap = arg1;
const items = [closure_2, closure_3];
const items1 = [arg0, arg1];
return _require(589).useStateFromStores(items, () => {
let isCallActiveResult = closure_1_2.isCallActive(closure_0, closure_1);
if (isCallActiveResult) {
const participants = closure_1_3.getParticipants(closure_0);
isCallActiveResult = participants.some((type) => type.type === constants.USER && !type.ringing);
}
return isCallActiveResult;
}, items1);
};
export const checkIsCallActive = function checkIsCallActive(channelId, id) {
let isCallActiveResult = callActive.isCallActive(channelId, id);
if (isCallActiveResult) {
participants = participants.getParticipants(channelId);
isCallActiveResult = participants.some((type) => type.type === constants.USER && !type.ringing);
}
return isCallActiveResult;
};
export const useIsCallActiveNullable = function useIsCallActiveNullable(id) {
const _require = id;
dependencyMap = arg1;
const items = [closure_2, closure_3];
const items1 = [id, arg1];
return _require(589).useStateFromStores(items, () => {
let tmp2 = null != closure_0;
if (tmp2) {
let isCallActiveResult = closure_1_2.isCallActive(tmp, closure_1);
if (isCallActiveResult) {
const participants = closure_1_3.getParticipants(tmp);
isCallActiveResult = participants.some((type) => type.type === constants.USER && !type.ringing);
}
tmp2 = isCallActiveResult;
}
return tmp2;
}, items1);
};