Fix the view to correctly display the active iframe based on which is currently hosting the active call (juggling views)

This commit is contained in:
Gigiaj 2025-05-11 17:54:11 -05:00
parent d488c24974
commit 5ab0b39152

View file

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