use claim url for download link to fix downloading reposts

This commit is contained in:
Sean Yesmunt 2020-02-05 13:08:37 -05:00
parent cd2e211689
commit 7ae8f79299

View file

@ -90,6 +90,7 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
const abandoned = !isResolvingUri && !claim; const abandoned = !isResolvingUri && !claim;
const showPublishLink = abandoned && placeholder === 'publish'; const showPublishLink = abandoned && placeholder === 'publish';
const hideActions = type === 'small' || type === 'tooltip'; const hideActions = type === 'small' || type === 'tooltip';
const canonicalUrl = claim && claim.canonical_url;
let isValid = false; let isValid = false;
if (uri) { if (uri) {
@ -239,9 +240,11 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
<NavLink {...navLinkProps}> <NavLink {...navLinkProps}>
<FileThumbnail thumbnail={thumbnailUrl}> <FileThumbnail thumbnail={thumbnailUrl}>
{/* @if TARGET='app' */} {/* @if TARGET='app' */}
<div className="claim-preview__hover-actions"> {claim && (
<FileDownloadLink uri={uri} hideOpenButton hideDownloadStatus /> <div className="claim-preview__hover-actions">
</div> <FileDownloadLink uri={canonicalUrl} hideOpenButton hideDownloadStatus />
</div>
)}
{/* @endif */} {/* @endif */}
</FileThumbnail> </FileThumbnail>
</NavLink> </NavLink>