diff --git a/src/ui/component/claimPreview/view.jsx b/src/ui/component/claimPreview/view.jsx index 8a2d73485..8d178fa28 100644 --- a/src/ui/component/claimPreview/view.jsx +++ b/src/ui/component/claimPreview/view.jsx @@ -61,9 +61,16 @@ function ClaimPreview(props: Props) { } = props; const haventFetched = claim === undefined; const abandoned = !isResolvingUri && !claim && !placeholder; - const { isChannel } = parseURI(uri); const claimsInChannel = (claim && claim.meta.claims_in_channel) || 0; + let isValid; + try { + parseURI(uri); + isValid = true; + } catch (e) { + isValid = false; + } + const isChannel = isValid ? parseURI(uri).isChannel : false; let shouldHide = abandoned || (!claimIsMine && obscureNsfw && nsfw); // This will be replaced once blocking is done at the wallet server level @@ -90,7 +97,7 @@ function ClaimPreview(props: Props) { } useEffect(() => { - if (!isResolvingUri && haventFetched && uri) { + if (isValid && !isResolvingUri && haventFetched && uri) { resolveUri(uri); } }, [isResolvingUri, uri, resolveUri, haventFetched]); @@ -118,7 +125,7 @@ function ClaimPreview(props: Props) { onContextMenu={handleContextMenu} className={classnames('claim-preview', { 'claim-preview--large': type === 'large', - 'claim-preview--visited': hasVisitedUri, + 'claim-preview--visited': !isChannel && hasVisitedUri, 'claim-preview--pending': pending, })} > diff --git a/src/ui/component/transactionList/internal/transaction-list-item.jsx b/src/ui/component/transactionList/internal/transaction-list-item.jsx index 8984b24d5..fae6f93e9 100644 --- a/src/ui/component/transactionList/internal/transaction-list-item.jsx +++ b/src/ui/component/transactionList/internal/transaction-list-item.jsx @@ -44,10 +44,12 @@ class TransactionListItem extends React.PureComponent { const { amount, claim_id: claimId, claim_name: name, date, fee, txid, type } = transaction; // Ensure the claim name exists and is valid + let uri; let claimName = name; - if (claimName) { + try { ({ claimName } = parseURI(name)); - } + uri = buildURI({ claimName: claimName, claimId }); + } catch (e) {} const dateFormat = { month: 'short', @@ -72,9 +74,7 @@ class TransactionListItem extends React.PureComponent { {reward && {reward.reward_title}} - {claimName && claimId && ( -