From 4dfcb4645abc008c4a760f841d4cbe35cd72da7a Mon Sep 17 00:00:00 2001 From: saltrafael Date: Tue, 17 Aug 2021 14:23:57 -0300 Subject: [PATCH] Fix Question Mark appearing on address --- ui/page/show/view.jsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ui/page/show/view.jsx b/ui/page/show/view.jsx index 140468b5e..515a1e677 100644 --- a/ui/page/show/view.jsx +++ b/ui/page/show/view.jsx @@ -91,11 +91,13 @@ function ShowPage(props: Props) { const hostname = isDev ? 'localhost' : DOMAIN; if (canonicalUrlPath !== window.location.pathname && hostname === window.location.hostname) { const urlParams = new URLSearchParams(search); + let replaceUrl = canonicalUrlPath; if (urlParams.get(COLLECTIONS_CONSTS.COLLECTION_ID)) { const listId = urlParams.get(COLLECTIONS_CONSTS.COLLECTION_ID) || ''; urlParams.set(COLLECTIONS_CONSTS.COLLECTION_ID, listId); + replaceUrl += `?${urlParams.toString()}`; } - history.replaceState(history.state, '', `${canonicalUrlPath}?${urlParams.toString()}`); + history.replaceState(history.state, '', replaceUrl); } } // @endif @@ -106,7 +108,7 @@ function ShowPage(props: Props) { ) { resolveUri(uri); } - }, [resolveUri, isResolvingUri, canonicalUrl, uri, claimExists, haventFetchedYet, history, isMine, claimIsPending]); + }, [resolveUri, isResolvingUri, canonicalUrl, uri, claimExists, haventFetchedYet, isMine, claimIsPending, search]); // Don't navigate directly to repost urls // Always redirect to the actual content