fix: resolve lint shadowing warning and typecheck types

This commit is contained in:
7w1 committed 2026-07-24 23:11:17 -05:00
1 parent ab44c51cdf
commit ac8e1fd6cb
1 file changed
+5 -3
+5 -3
View File
@@ -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<HTMLDivElement, RoomInputProps>(
};
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;