From dcac5ebcc98c2d7fb3d1e5257a7a6f30cc666b64 Mon Sep 17 00:00:00 2001 From: zeppi Date: Tue, 10 Aug 2021 10:38:53 -0400 Subject: [PATCH] fix collection preview links --- ui/component/claimPreview/view.jsx | 11 +++++------ ui/page/file/index.js | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/ui/component/claimPreview/view.jsx b/ui/component/claimPreview/view.jsx index 0578e81dd..00e153930 100644 --- a/ui/component/claimPreview/view.jsx +++ b/ui/component/claimPreview/view.jsx @@ -202,10 +202,9 @@ const ClaimPreview = forwardRef((props: Props, ref: any) => { let ariaLabelData = isChannelUri ? title : formatClaimPreviewTitle(title, channelTitle, date, mediaDuration); let navigateUrl = formatLbryUrlForWeb((claim && claim.canonical_url) || uri || '/'); + let navigateSearch = new URLSearchParams(); if (listId) { - const collectionParams = new URLSearchParams(); - collectionParams.set(COLLECTIONS_CONSTS.COLLECTION_ID, listId); - navigateUrl = navigateUrl + `?` + collectionParams.toString(); + navigateSearch.set(COLLECTIONS_CONSTS.COLLECTION_ID, listId); } const handleNavLinkClick = (e) => { @@ -218,6 +217,7 @@ const ClaimPreview = forwardRef((props: Props, ref: any) => { const navLinkProps = { to: { pathname: navigateUrl, + search: navigateSearch.toString() ? '?' + navigateSearch.toString() : '', state: containerId ? { [CONTAINER_ID]: containerId } : undefined, }, onClick: (e) => handleNavLinkClick(e), @@ -273,6 +273,7 @@ const ClaimPreview = forwardRef((props: Props, ref: any) => { if (claim && !pending && !disableNavigation) { history.push({ pathname: navigateUrl, + search: navigateSearch.toString() ? '?' + navigateSearch.toString() : '', state: containerId ? { [CONTAINER_ID]: containerId } : undefined, }); } @@ -363,9 +364,7 @@ const ClaimPreview = forwardRef((props: Props, ref: any) => {
- {isPlayable && ( - - )} + {isPlayable && }
{/* @if TARGET='app' */} diff --git a/ui/page/file/index.js b/ui/page/file/index.js index 6d8515fb0..b582a41f6 100644 --- a/ui/page/file/index.js +++ b/ui/page/file/index.js @@ -1,6 +1,6 @@ import { connect } from 'react-redux'; import { doSetContentHistoryItem, doSetPrimaryUri } from 'redux/actions/content'; -import { withRouter } from 'react-router'; +import { withRouter } from 'react-router-dom'; import { doFetchFileInfo, makeSelectFileInfoForUri,