Fix undefined URLs

This commit is contained in:
Michael Tintiuc 2020-02-05 01:54:49 +02:00 committed by Sean Yesmunt
parent c94fdb2749
commit 69fe40fbe1
2 changed files with 3 additions and 4 deletions

View file

@ -102,8 +102,7 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
const isChannel = isValid ? parseURI(uri).isChannel : false;
const signingChannel = claim && claim.signing_channel;
const canonicalUrl = claim && claim.canonical_url;
const navigateUrl = canonicalUrl ? formatLbryUrlForWeb(canonicalUrl) : undefined;
const navigateUrl = formatLbryUrlForWeb((claim && claim.canonical_url) || uri || '/');
const navLinkProps = {
to: navigateUrl,
onClick: e => e.stopPropagation(),
@ -168,7 +167,7 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
}
if (claim && !pending) {
history.push(navigateUrl || uri);
history.push(navigateUrl);
}
}

View file

@ -59,7 +59,7 @@ function ClaimPreviewTile(props: Props) {
const thumbnailUrl = useGetThumbnail(uri, claim, streamingUrl, getFile, placeholder) || thumbnail;
const claimsInChannel = (claim && claim.meta.claims_in_channel) || 0;
const canonicalUrl = claim && claim.canonical_url;
const navigateUrl = canonicalUrl ? formatLbryUrlForWeb(canonicalUrl) : undefined;
const navigateUrl = formatLbryUrlForWeb(canonicalUrl || uri || '/');
const navLinkProps = {
to: navigateUrl,