Fix narrow-screen initial render in FinderWindow

This commit is contained in:
Richard R 2026-05-29 22:27:30 -06:00
parent d120719abd
commit 2695c7055b

View file

@ -17,7 +17,9 @@ interface FinderWindowProps {
const NARROW_QUERY = '(max-width: 767px)';
export function useIsNarrow(): boolean {
const [isNarrow, setIsNarrow] = useState(false);
const [isNarrow, setIsNarrow] = useState(() =>
typeof window !== 'undefined' ? window.matchMedia(NARROW_QUERY).matches : false,
);
useEffect(() => {
if (typeof window === 'undefined') return;
const mq = window.matchMedia(NARROW_QUERY);