mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-06 15:30:27 +03:00
Better handling of the isCallActive in the join handler
This commit is contained in:
parent
af455a5fe3
commit
3e3d68602f
1 changed files with 8 additions and 5 deletions
|
|
@ -240,18 +240,21 @@ export function CallProvider({ children }: CallProviderProps) {
|
||||||
|
|
||||||
const handleJoin = (ev: CustomEvent) => {
|
const handleJoin = (ev: CustomEvent) => {
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
|
|
||||||
logger.error(isCallActive.toString());
|
logger.error(isCallActive.toString());
|
||||||
logger.error(activeClientWidgetApi);
|
logger.error(activeClientWidgetApi);
|
||||||
logger.error(viewedClientWidgetApi);
|
logger.error(viewedClientWidgetApi);
|
||||||
|
|
||||||
activeClientWidgetApi?.transport.reply(ev.detail, {});
|
activeClientWidgetApi?.transport.reply(ev.detail, {});
|
||||||
if (isCallActive && activeClientWidgetApi && viewedClientWidgetApi) {
|
if (isCallActive && activeClientWidgetApi && viewedClientWidgetApi) {
|
||||||
activeClientWidgetApi?.transport.send(WIDGET_HANGUP_ACTION, {}).then(() => {});
|
activeClientWidgetApi?.transport.send(WIDGET_HANGUP_ACTION, {}).then(() => {
|
||||||
setActiveCallRoomIdState(viewedCallRoomId);
|
setActiveCallRoomIdState(viewedCallRoomId);
|
||||||
setActiveClientWidgetApi(viewedClientWidgetApi, viewedCallRoomId);
|
setActiveClientWidgetApi(viewedClientWidgetApi, viewedCallRoomId);
|
||||||
setIsPrimaryIframe(!isPrimaryIframe);
|
setIsPrimaryIframe(!isPrimaryIframe);
|
||||||
}
|
});
|
||||||
|
} else {
|
||||||
setIsCallActive(true);
|
setIsCallActive(true);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
logger.debug(
|
logger.debug(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue