From 05c9d3513a1759f31f8a6df5645a41aa8381705c Mon Sep 17 00:00:00 2001 From: James Grugett Date: Wed, 10 Aug 2022 12:05:52 -0500 Subject: [PATCH] Don't reference window outside useEffect or click event. --- web/components/nav/sidebar.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/components/nav/sidebar.tsx b/web/components/nav/sidebar.tsx index 713bc575..8879c052 100644 --- a/web/components/nav/sidebar.tsx +++ b/web/components/nav/sidebar.tsx @@ -329,7 +329,7 @@ function GroupsList(props: { const { height } = useWindowSize() const [containerRef, setContainerRef] = useState(null) const remainingHeight = - (height ?? window.innerHeight) - (containerRef?.offsetTop ?? 0) + (height ?? 0) - (containerRef?.offsetTop ?? 0) const notifIsForThisItem = useMemo( () => (itemHref: string) =>