Sets initial states so the iframes don't cause the other to fail with the npm embedded package

This commit is contained in:
Gigiaj 2025-05-23 01:52:38 -05:00
parent 1871f70704
commit 9302003c30
2 changed files with 3 additions and 1 deletions

View file

@ -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);
}

View file

@ -142,6 +142,7 @@ export function PersistentCallContainer({ children }: PersistentCallContainerPro
);
useEffect(() => {
if ((activeCallRoomId && !viewedCallRoomId) || activeCallRoomId)
setupWidget(primaryWidgetApiRef, primarySmallWidgetRef, primaryIframeRef, isPrimaryIframe);
setupWidget(backupWidgetApiRef, backupSmallWidgetRef, backupIframeRef, !isPrimaryIframe);
}, [