From c6ceb3f977f7e0f95eabad37c887c7434010dc5f Mon Sep 17 00:00:00 2001 From: Gigiaj Date: Thu, 22 May 2025 19:42:46 -0500 Subject: [PATCH] revert ternary expression change and add to dependency array --- src/app/features/room/CallView.tsx | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/app/features/room/CallView.tsx b/src/app/features/room/CallView.tsx index fd3c73bd..ecd28957 100644 --- a/src/app/features/room/CallView.tsx +++ b/src/app/features/room/CallView.tsx @@ -1,3 +1,4 @@ +/* eslint-disable no-nested-ternary */ import { Room } from 'matrix-js-sdk'; import React, { useContext, useMemo } from 'react'; import { useCallback, useEffect, useRef } from 'react'; @@ -49,9 +50,13 @@ export function CallView({ room, eventId }: { room: Room; eventId?: string }) { const screenSize = useScreenSizeContext(); const isMobile = screenSize === ScreenSize.Mobile; - - const activeIframeDisplayRef = - isViewingActiveCall && isPrimaryIframe ? primaryIframeRef : backupIframeRef; + const activeIframeDisplayRef = isPrimaryIframe + ? isViewingActiveCall + ? primaryIframeRef + : backupIframeRef + : isViewingActiveCall + ? backupIframeRef + : primaryIframeRef; const applyFixedPositioningToIframe = useCallback(() => { const iframeElement = activeIframeDisplayRef?.current; @@ -120,13 +125,7 @@ export function CallView({ room, eventId }: { room: Room; eventId?: string }) { originalIframeStylesRef.current = null; }; } - }, [ - activeIframeDisplayRef, - applyFixedPositioningToIframe, - debouncedApplyFixedPositioning, - isPrimaryIframe, - isViewingActiveCall, - ]); + }, [activeIframeDisplayRef, applyFixedPositioningToIframe, debouncedApplyFixedPositioning, isPrimaryIframe, isViewingActiveCall, room]); const isCallViewVisible = room.isCallRoom();