From e40aa84a40c6f0b9a843b80a51209e20344a85af Mon Sep 17 00:00:00 2001 From: zeppi Date: Fri, 11 Jun 2021 17:46:52 -0400 Subject: [PATCH] fix canonical redirect --- ui/page/show/view.jsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ui/page/show/view.jsx b/ui/page/show/view.jsx index a1986bb63..379cda46c 100644 --- a/ui/page/show/view.jsx +++ b/ui/page/show/view.jsx @@ -84,7 +84,12 @@ function ShowPage(props: Props) { // Only redirect if we are in lbry.tv land // replaceState will fail if on a different domain (like webcache.googleusercontent.com) if (canonicalUrlPath !== window.location.pathname && DOMAIN === window.location.hostname) { - history.replaceState(history.state, '', canonicalUrlPath); + const urlParams = new URLSearchParams(search); + if (urlParams.get(COLLECTIONS_CONSTS.COLLECTION_ID)) { + const listId = urlParams.get(COLLECTIONS_CONSTS.COLLECTION_ID) || ''; + urlParams.set(COLLECTIONS_CONSTS.COLLECTION_ID, listId); + } + history.replaceState(history.state, '', `${canonicalUrlPath}?${urlParams.toString()}`); } } // @endif