From 9302003c3019ed1b0e146bcdcb0bd0af5d0dea60 Mon Sep 17 00:00:00 2001 From: Gigiaj Date: Fri, 23 May 2025 01:52:38 -0500 Subject: [PATCH] Sets initial states so the iframes don't cause the other to fail with the npm embedded package --- src/app/features/room-nav/RoomNavItem.tsx | 1 + src/app/pages/client/call/PersistentCallContainer.tsx | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/features/room-nav/RoomNavItem.tsx b/src/app/features/room-nav/RoomNavItem.tsx index 89ac9061..00992a32 100644 --- a/src/app/features/room-nav/RoomNavItem.tsx +++ b/src/app/features/room-nav/RoomNavItem.tsx @@ -266,6 +266,7 @@ export function RoomNavItem({ if (room.isCallRoom() && activeCallRoomId !== room.roomId) { hangUp(); setActiveCallRoomId(room.roomId); + setViewedCallRoomId(room.roomId); if (mx.getRoom(viewedRoomId)?.isCallRoom()) { navigateRoom(room.roomId); } diff --git a/src/app/pages/client/call/PersistentCallContainer.tsx b/src/app/pages/client/call/PersistentCallContainer.tsx index a3741673..7c2319ac 100644 --- a/src/app/pages/client/call/PersistentCallContainer.tsx +++ b/src/app/pages/client/call/PersistentCallContainer.tsx @@ -142,7 +142,8 @@ export function PersistentCallContainer({ children }: PersistentCallContainerPro ); useEffect(() => { - setupWidget(primaryWidgetApiRef, primarySmallWidgetRef, primaryIframeRef, isPrimaryIframe); + if ((activeCallRoomId && !viewedCallRoomId) || activeCallRoomId) + setupWidget(primaryWidgetApiRef, primarySmallWidgetRef, primaryIframeRef, isPrimaryIframe); setupWidget(backupWidgetApiRef, backupSmallWidgetRef, backupIframeRef, !isPrimaryIframe); }, [ setupWidget,