From ac8e1fd6cb7bea8bdd2501048f4ac2da0b2b7b46 Mon Sep 17 00:00:00 2001 From: 7w1 Date: Fri, 24 Jul 2026 23:11:17 -0500 Subject: [PATCH] fix: resolve lint shadowing warning and typecheck types --- src/app/features/room/RoomInput.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/app/features/room/RoomInput.tsx b/src/app/features/room/RoomInput.tsx index 3b03e96bd..af028c8db 100644 --- a/src/app/features/room/RoomInput.tsx +++ b/src/app/features/room/RoomInput.tsx @@ -109,6 +109,7 @@ import { loadImageElementFromMediaUrl } from '$utils/dom'; import { safeFile } from '$utils/mimeTypes'; import { fulfilledPromiseSettledResult } from '$utils/common'; import { useSetting } from '$state/hooks/settings'; +import type { EditorButtonId } from '$state/settings'; import { settingsAtom } from '$state/settings'; import { matchesShortcut } from '../../keyboard/shortcuts'; import { @@ -2352,9 +2353,10 @@ export const RoomInput = forwardRef( }; for (let i = editorButtonOrder.length - 1; i >= 0; i--) { const id = editorButtonOrder[i]; - const ref = buttonRefs[id]; - if (ref?.current) { - return ref.current.getBoundingClientRect(); + if (!id) continue; + const btnRef = buttonRefs[id]; + if (btnRef?.current) { + return btnRef.current.getBoundingClientRect(); } } return undefined;