From 5ab0b39152a4d03a87163fa90d6b770aed026b0b Mon Sep 17 00:00:00 2001 From: Gigiaj Date: Sun, 11 May 2025 17:54:11 -0500 Subject: [PATCH] Fix the view to correctly display the active iframe based on which is currently hosting the active call (juggling views) --- src/app/features/room/CallView.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/app/features/room/CallView.tsx b/src/app/features/room/CallView.tsx index 7cf6735c..fd3c73bd 100644 --- a/src/app/features/room/CallView.tsx +++ b/src/app/features/room/CallView.tsx @@ -50,7 +50,8 @@ export function CallView({ room, eventId }: { room: Room; eventId?: string }) { const screenSize = useScreenSizeContext(); const isMobile = screenSize === ScreenSize.Mobile; - const activeIframeDisplayRef = isPrimaryIframe ? primaryIframeRef : backupIframeRef; + const activeIframeDisplayRef = + isViewingActiveCall && isPrimaryIframe ? primaryIframeRef : backupIframeRef; const applyFixedPositioningToIframe = useCallback(() => { const iframeElement = activeIframeDisplayRef?.current; @@ -97,7 +98,7 @@ export function CallView({ room, eventId }: { room: Room; eventId?: string }) { const iframeElement = activeIframeDisplayRef?.current; const hostElement = iframeHostRef?.current; - if (!isPrimaryIframe || (isViewingActiveCall && iframeElement && hostElement)) { + if (room.isCallRoom() || (isViewingActiveCall && iframeElement && hostElement)) { applyFixedPositioningToIframe(); const resizeObserver = new ResizeObserver(debouncedApplyFixedPositioning);