From df85bcf2a596abc6357ee94c832b6b9096ce6dec Mon Sep 17 00:00:00 2001 From: Scott Nonnenberg Date: Tue, 6 Jan 2026 04:59:27 +1000 Subject: [PATCH] Ensure setLocalPreviewContainer is called when video is enabled --- ts/components/CallScreen.dom.tsx | 5 ++++- ts/components/CallingPip.dom.tsx | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ts/components/CallScreen.dom.tsx b/ts/components/CallScreen.dom.tsx index e277fa09da..38f2baaca3 100644 --- a/ts/components/CallScreen.dom.tsx +++ b/ts/components/CallScreen.dom.tsx @@ -552,6 +552,9 @@ export function CallScreen({ ); React.useLayoutEffect(() => { + if (!isSendingVideo) { + return; + } if (isLonelyInCall && !lonelyCallPreviewRef.current) { return; } @@ -571,7 +574,7 @@ export function CallScreen({ sizeCallback: handleSize, }); } - }, [handleSize, isLonelyInCall, setLocalPreviewContainer]); + }, [isSendingVideo, handleSize, isLonelyInCall, setLocalPreviewContainer]); const { selfViewExpanded } = activeCall; const previousSelfViewExpanded = usePrevious( diff --git a/ts/components/CallingPip.dom.tsx b/ts/components/CallingPip.dom.tsx index 23a9ae1509..1344b0501e 100644 --- a/ts/components/CallingPip.dom.tsx +++ b/ts/components/CallingPip.dom.tsx @@ -480,6 +480,9 @@ export function CallingPip({ ); React.useLayoutEffect(() => { + if (!isSendingVideo) { + return; + } if (isLonelyInCall && !lonelyCallPreviewRef.current) { return; } @@ -499,7 +502,7 @@ export function CallingPip({ sizeCallback: handleSize, }); } - }, [handleSize, isLonelyInCall, setLocalPreviewContainer]); + }, [isSendingVideo, handleSize, isLonelyInCall, setLocalPreviewContainer]); if (isLonelyInCall) { remoteVideoNode = (