diff --git a/src/app/components/CallEmbedProvider.tsx b/src/app/components/CallEmbedProvider.tsx index aac473ed4..8412d0c48 100644 --- a/src/app/components/CallEmbedProvider.tsx +++ b/src/app/components/CallEmbedProvider.tsx @@ -544,9 +544,9 @@ export function CallEmbedProvider({ children }: CallEmbedProviderProps) { const margin = 16; const w = el.offsetWidth; const h = el.offsetHeight; - const rect = el.getBoundingClientRect(); - const cx = rect.left + w / 2; - const cy = rect.top + h / 2; + const elRect = el.getBoundingClientRect(); + const cx = elRect.left + w / 2; + const cy = elRect.top + h / 2; const snapLeft = cx < window.innerWidth / 2 ? margin : window.innerWidth - w - margin; const snapTop = cy < window.innerHeight / 2 ? margin : window.innerHeight - h - margin; el.style.left = `${snapLeft}px`; @@ -600,8 +600,11 @@ export function CallEmbedProvider({ children }: CallEmbedProviderProps) { document.body.style.userSelect = ''; activeDragCleanupRef.current = null; if (el && pipDragRef.current?.dragged) { - const rect = el.getBoundingClientRect(); - localStorage.setItem('pip-position', JSON.stringify({ left: rect.left, top: rect.top })); + const savedRect = el.getBoundingClientRect(); + localStorage.setItem( + 'pip-position', + JSON.stringify({ left: savedRect.left, top: savedRect.top }), + ); } setTimeout(() => { if (pipDragRef.current) pipDragRef.current.dragged = false; @@ -655,8 +658,11 @@ export function CallEmbedProvider({ children }: CallEmbedProviderProps) { document.removeEventListener('touchend', onTouchEnd); activeDragCleanupRef.current = null; if (el && pipDragRef.current?.dragged) { - const rect = el.getBoundingClientRect(); - localStorage.setItem('pip-position', JSON.stringify({ left: rect.left, top: rect.top })); + const savedRect = el.getBoundingClientRect(); + localStorage.setItem( + 'pip-position', + JSON.stringify({ left: savedRect.left, top: savedRect.top }), + ); } setTimeout(() => { if (pipDragRef.current) pipDragRef.current.dragged = false; diff --git a/src/app/features/message-search/MessageSearch.tsx b/src/app/features/message-search/MessageSearch.tsx index 773e588b6..7f790e3b0 100644 --- a/src/app/features/message-search/MessageSearch.tsx +++ b/src/app/features/message-search/MessageSearch.tsx @@ -211,7 +211,6 @@ export function MessageSearch({ // Run synchronous client-side search over encrypted rooms immediately. // cacheVersion in deps so it re-runs after "Load more" paginates new events. - // eslint-disable-next-line react-hooks/exhaustive-deps const localResult = useMemo(() => { if (!msgSearchParams.term) return null; return searchLocalMessages({