mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-05 15:00:30 +03:00
Seems to avoid almost all invalid states (hang up while viewing another lobby and hitting join seems to black screen, sets the active call as the previous active room id, but does join the viewed room correctly)
This commit is contained in:
parent
22903c9340
commit
108eb60b4a
1 changed files with 6 additions and 5 deletions
|
|
@ -207,15 +207,14 @@ export function CallProvider({ children }: CallProviderProps) {
|
|||
(nextRoom: string) => {
|
||||
setIsCallActive(false);
|
||||
if (typeof nextRoom !== 'string') {
|
||||
if (viewedCallRoomId === activeCallRoomId) {
|
||||
if (activeCallRoomId && viewedCallRoomId === activeCallRoomId) {
|
||||
setIsPrimaryIframe(!isPrimaryIframe);
|
||||
} else {
|
||||
setViewedCallRoomId(activeCallRoomId);
|
||||
}
|
||||
logger.error(`${activeCallRoomId} ${viewedCallRoomId}`);
|
||||
setViewedCallRoomId(activeCallRoomId);
|
||||
} else if (viewedCallRoomId !== null) {
|
||||
setIsPrimaryIframe(!isPrimaryIframe);
|
||||
setViewedCallRoomId(null);
|
||||
}
|
||||
} else if (activeCallRoomId) setViewedCallRoomId(nextRoom);
|
||||
setActiveClientWidgetApi(null, null, null);
|
||||
setActiveCallRoomId(null);
|
||||
|
||||
|
|
@ -323,6 +322,8 @@ export function CallProvider({ children }: CallProviderProps) {
|
|||
activeClientWidgetApi?.removeAllListeners();
|
||||
activeClientWidgetApi?.transport.send(WIDGET_HANGUP_ACTION, {}).then(() => {
|
||||
setViewedAsActive();
|
||||
setViewedCallRoomIdState(null);
|
||||
setViewedClientWidgetApi(null, null, null);
|
||||
});
|
||||
} else {
|
||||
setIsCallActive(true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue