mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-05 06:50:28 +03:00
Fix for cases where you're viewing a lobby and hang up your existing call and try to join lobby (was not rendering for the correct room id, but was joining the correct call prior)
This commit is contained in:
parent
108eb60b4a
commit
1a821961f3
1 changed files with 5 additions and 21 deletions
|
|
@ -313,10 +313,6 @@ export function CallProvider({ children }: CallProviderProps) {
|
|||
};
|
||||
activeClientWidgetApi?.transport.reply(ev.detail, {});
|
||||
|
||||
if (ev.detail.widgetId === activeClientWidgetApi?.widget.id) {
|
||||
setIsCallActive(true);
|
||||
return;
|
||||
}
|
||||
if (activeClientWidgetApi) {
|
||||
if (isCallActive && viewedClientWidgetApi && viewedCallRoomId) {
|
||||
activeClientWidgetApi?.removeAllListeners();
|
||||
|
|
@ -328,6 +324,10 @@ export function CallProvider({ children }: CallProviderProps) {
|
|||
} else {
|
||||
setIsCallActive(true);
|
||||
}
|
||||
} else if (viewedCallRoomId !== viewedRoomId) {
|
||||
setViewedCallRoomId(viewedRoomId);
|
||||
setActiveCallRoomIdState(viewedCallRoomId);
|
||||
setIsCallActive(true);
|
||||
} else {
|
||||
setViewedAsActive();
|
||||
}
|
||||
|
|
@ -347,23 +347,7 @@ export function CallProvider({ children }: CallProviderProps) {
|
|||
viewedClientWidgetApi?.on(`action:${WIDGET_TILE_UPDATE}`, handleOnTileLayout);
|
||||
viewedClientWidgetApi?.on(`action:${WIDGET_ON_SCREEN_ACTION}`, handleOnScreenStateUpdate);
|
||||
viewedClientWidgetApi?.on(`action:${WIDGET_HANGUP_ACTION}`, handleHangup);
|
||||
}, [
|
||||
activeClientWidgetApi,
|
||||
activeCallRoomId,
|
||||
activeClientWidgetApiRoomId,
|
||||
hangUp,
|
||||
isChatOpen,
|
||||
isAudioEnabled,
|
||||
isVideoEnabled,
|
||||
isCallActive,
|
||||
viewedRoomId,
|
||||
viewedClientWidgetApi,
|
||||
isPrimaryIframe,
|
||||
viewedCallRoomId,
|
||||
setViewedClientWidgetApi,
|
||||
setActiveClientWidgetApi,
|
||||
viewedClientWidget,
|
||||
]);
|
||||
}, [activeClientWidgetApi, activeCallRoomId, activeClientWidgetApiRoomId, hangUp, isChatOpen, isAudioEnabled, isVideoEnabled, isCallActive, viewedRoomId, viewedClientWidgetApi, isPrimaryIframe, viewedCallRoomId, setViewedClientWidgetApi, setActiveClientWidgetApi, viewedClientWidget, setViewedCallRoomId]);
|
||||
|
||||
const sendWidgetAction = useCallback(
|
||||
async <T = unknown,>(action: WidgetApiToWidgetAction | string, data: T): Promise<void> => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue