mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-04 22:40:29 +03:00
Solves CCH. Looks like CLCH left
This commit is contained in:
parent
923982ef30
commit
0e332d6616
1 changed files with 12 additions and 8 deletions
|
|
@ -204,27 +204,31 @@ export function CallProvider({ children }: CallProviderProps) {
|
||||||
|
|
||||||
const hangUp = useCallback(
|
const hangUp = useCallback(
|
||||||
(nextRoom: string) => {
|
(nextRoom: string) => {
|
||||||
setIsCallActive(false);
|
if (isCallActive) {
|
||||||
if (typeof nextRoom !== 'string') {
|
if (typeof nextRoom !== 'string') {
|
||||||
if (activeCallRoomId && viewedCallRoomId === activeCallRoomId) {
|
if (activeCallRoomId && viewedCallRoomId === activeCallRoomId) {
|
||||||
setIsPrimaryIframe(!isPrimaryIframe);
|
if (viewedClientWidget !== null) setIsPrimaryIframe(!isPrimaryIframe);
|
||||||
} else if (viewedCallRoomId !== viewedRoomId) setViewedCallRoomId(activeCallRoomId);
|
} else if (viewedCallRoomId !== viewedRoomId) {
|
||||||
} else if (activeCallRoomId) setViewedCallRoomId(nextRoom);
|
setViewedCallRoomId(activeCallRoomId);
|
||||||
|
}
|
||||||
|
} else if (activeCallRoomId) setViewedCallRoomId(nextRoom);
|
||||||
|
}
|
||||||
setActiveClientWidgetApi(null, null, null);
|
setActiveClientWidgetApi(null, null, null);
|
||||||
setActiveCallRoomId(null);
|
setActiveCallRoomId(null);
|
||||||
|
setIsCallActive(false);
|
||||||
logger.debug(`CallContext: Hang up called.`);
|
logger.debug(`CallContext: Hang up called.`);
|
||||||
activeClientWidgetApi?.transport.send(`${WIDGET_HANGUP_ACTION}`, {});
|
activeClientWidgetApi?.transport.send(`${WIDGET_HANGUP_ACTION}`, {});
|
||||||
},
|
},
|
||||||
[
|
[
|
||||||
activeCallRoomId,
|
activeCallRoomId,
|
||||||
activeClientWidgetApi?.transport,
|
activeClientWidgetApi?.transport,
|
||||||
|
isCallActive,
|
||||||
isPrimaryIframe,
|
isPrimaryIframe,
|
||||||
setActiveCallRoomId,
|
setActiveCallRoomId,
|
||||||
setActiveClientWidgetApi,
|
setActiveClientWidgetApi,
|
||||||
setViewedCallRoomId,
|
setViewedCallRoomId,
|
||||||
viewedCallRoomId,
|
viewedCallRoomId,
|
||||||
|
viewedClientWidget,
|
||||||
viewedRoomId,
|
viewedRoomId,
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue