fix: resolve ESLint no-shadow errors in CallEmbedProvider
CI / Build & Quality Checks (push) Successful in 10m24s

The rect variable in the onUp and onTouchEnd closures was shadowing the
outer rect declaration in handlePipMouseDown and handlePipTouchStart.
Renamed inner declarations to savedRect. Also renamed rect → elRect in
handlePipDoubleClick for the same reason.

Removed unused eslint-disable-next-line comment in MessageSearch.tsx.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-30 17:31:38 -04:00
parent 403ec3d80c
commit 32384e9820
2 changed files with 13 additions and 8 deletions
+13 -7
View File
@@ -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;
@@ -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({