From 2695c7055b5c5a3776aa09a60d1cc97b0178dd72 Mon Sep 17 00:00:00 2001 From: Richard R Date: Fri, 29 May 2026 22:27:30 -0600 Subject: [PATCH] Fix narrow-screen initial render in FinderWindow --- src/components/doclist/window/FinderWindow.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/doclist/window/FinderWindow.tsx b/src/components/doclist/window/FinderWindow.tsx index f8cb535..be5f157 100644 --- a/src/components/doclist/window/FinderWindow.tsx +++ b/src/components/doclist/window/FinderWindow.tsx @@ -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);