From f038f5e9ef6d2982d5b269f4d5c0fefb65808060 Mon Sep 17 00:00:00 2001 From: Chuck Dries Date: Sun, 10 Jul 2022 17:35:00 -0700 Subject: [PATCH] keep tracking down window issues --- src/pages/photogallery/[...].js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/photogallery/[...].js b/src/pages/photogallery/[...].js index 17b74ee..c01deeb 100644 --- a/src/pages/photogallery/[...].js +++ b/src/pages/photogallery/[...].js @@ -17,7 +17,7 @@ const SORT_KEYS = { }; const GalleryPage = ({ data }) => { - const hash = window.location.hash.replace("#", ""); + const hash = typeof window !== "undefined" ? window.location.hash.replace("#", "") : ""; const [filterKeyword, _setKeyword] = React.useState(null); const [sortKey, _setSortKey] = React.useState("rating");