mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-05 15:00:30 +03:00
Provides correct behavior when call isn't active and no activeClientWidgetApi exists yet
This commit is contained in:
parent
b6afe3b968
commit
03cbecc3f9
1 changed files with 16 additions and 9 deletions
|
|
@ -243,8 +243,8 @@ export function CallProvider({ children }: CallProviderProps) {
|
||||||
setIsCallActive(true);
|
setIsCallActive(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (activeClientWidgetApi) {
|
||||||
if (isCallActive && activeClientWidgetApi && viewedClientWidgetApi) {
|
if (isCallActive && viewedClientWidgetApi) {
|
||||||
activeClientWidgetApi?.removeAllListeners();
|
activeClientWidgetApi?.removeAllListeners();
|
||||||
activeClientWidgetApi?.transport.send(WIDGET_HANGUP_ACTION, {}).then(() => {
|
activeClientWidgetApi?.transport.send(WIDGET_HANGUP_ACTION, {}).then(() => {
|
||||||
setActiveClientWidgetApi(viewedClientWidgetApi, viewedCallRoomId);
|
setActiveClientWidgetApi(viewedClientWidgetApi, viewedCallRoomId);
|
||||||
|
|
@ -256,6 +256,13 @@ export function CallProvider({ children }: CallProviderProps) {
|
||||||
} else {
|
} else {
|
||||||
setIsCallActive(true);
|
setIsCallActive(true);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
setIsPrimaryIframe(!isPrimaryIframe);
|
||||||
|
setActiveClientWidgetApi(viewedClientWidgetApi, viewedCallRoomId);
|
||||||
|
setActiveCallRoomIdState(viewedCallRoomId);
|
||||||
|
setViewedClientWidgetApi(null, null);
|
||||||
|
setIsCallActive(true);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
logger.debug(
|
logger.debug(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue