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) => {
|
||||
ev.preventDefault();
|
||||
|
||||
logger.error(isCallActive.toString());
|
||||
logger.error(activeClientWidgetApi);
|
||||
logger.error(viewedClientWidgetApi);
|
||||
|
||||
activeClientWidgetApi?.transport.reply(ev.detail, {});
|
||||
if (isCallActive && activeClientWidgetApi && viewedClientWidgetApi) {
|
||||
activeClientWidgetApi?.transport.send(WIDGET_HANGUP_ACTION, {}).then(() => {});
|
||||
setActiveCallRoomIdState(viewedCallRoomId);
|
||||
setActiveClientWidgetApi(viewedClientWidgetApi, viewedCallRoomId);
|
||||
setIsPrimaryIframe(!isPrimaryIframe);
|
||||
activeClientWidgetApi?.transport.send(WIDGET_HANGUP_ACTION, {}).then(() => {
|
||||
setActiveCallRoomIdState(viewedCallRoomId);
|
||||
setActiveClientWidgetApi(viewedClientWidgetApi, viewedCallRoomId);
|
||||
setIsPrimaryIframe(!isPrimaryIframe);
|
||||
});
|
||||
} else {
|
||||
setIsCallActive(true);
|
||||
}
|
||||
setIsCallActive(true);
|
||||
};
|
||||
|
||||
logger.debug(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue