forked from github/cinny
Provides correct behavior when call isn't active and no activeClientWidgetApi exists yet
This commit is contained in:
@@ -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(
|
||||||
|
|||||||
Reference in New Issue
Block a user