From 6fc8c166a03a96567b8a993beea8cb7017c52741 Mon Sep 17 00:00:00 2001 From: Chuck Dries Date: Thu, 9 Mar 2023 21:47:32 -0800 Subject: [PATCH] fix keyword picker re-attaching hashes to links --- src/pages/photogallery.tsx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/pages/photogallery.tsx b/src/pages/photogallery.tsx index bc2e6f7..05280c5 100644 --- a/src/pages/photogallery.tsx +++ b/src/pages/photogallery.tsx @@ -90,16 +90,17 @@ const GalleryPage = ({ if (!hash.length) { return; } - const url = new URL( - typeof window !== "undefined" - ? window.location.href.toString() - : "https://chuckdries.com/photogallery/" - ); + // const url = new URL( + // typeof window !== "undefined" + // ? window.location.href.toString() + // : "https://chuckdries.com/photogallery/" + // ); - url.hash = ""; - window.history.replaceState(null, "", url.href.toString()); + // url.hash = ""; + // window.history.replaceState(null, "", url.href.toString()); + navigate(getGalleryPageUrl({ sortKey, keyword: filterKeyword, showDebug}, ""), { replace: true }) window.removeEventListener("wheel", removeHash); - }, [hash]); + }, [hash, sortKey, filterKeyword, showDebug]); React.useEffect(() => { window.addEventListener("wheel", removeHash);