diff --git a/ui/component/claimPreview/index.js b/ui/component/claimPreview/index.js index 0a39ef6aa..20eeb0d2c 100644 --- a/ui/component/claimPreview/index.js +++ b/ui/component/claimPreview/index.js @@ -5,7 +5,6 @@ import { makeSelectIsUriResolving, makeSelectClaimIsMine, makeSelectClaimIsPending, - makeSelectThumbnailForUri, makeSelectCoverForUri, makeSelectClaimIsNsfw, selectBlockedChannels, @@ -28,7 +27,6 @@ const select = (state, props) => ({ obscureNsfw: !selectShowMatureContent(state), claimIsMine: props.uri && makeSelectClaimIsMine(props.uri)(state), isResolvingUri: props.uri && makeSelectIsUriResolving(props.uri)(state), - thumbnail: props.uri && makeSelectThumbnailForUri(props.uri)(state), cover: props.uri && makeSelectCoverForUri(props.uri)(state), nsfw: props.uri && makeSelectClaimIsNsfw(props.uri)(state), blackListedOutpoints: selectBlackListedOutpoints(state), diff --git a/ui/component/claimPreview/view.jsx b/ui/component/claimPreview/view.jsx index e11b50eb4..ef1960c62 100644 --- a/ui/component/claimPreview/view.jsx +++ b/ui/component/claimPreview/view.jsx @@ -34,7 +34,6 @@ type Props = { resolveUri: string => void, isResolvingUri: boolean, history: { push: string => void }, - thumbnail: string, title: string, nsfw: boolean, placeholder: string, @@ -71,7 +70,6 @@ const ClaimPreview = forwardRef((props: Props, ref: any) => { history, uri, isResolvingUri, - thumbnail, nsfw, resolveUri, claim, @@ -159,7 +157,7 @@ const ClaimPreview = forwardRef((props: Props, ref: any) => { // Weird placement warning // Make sure this happens after we figure out if this claim needs to be hidden - const thumbnailUrl = useGetThumbnail(uri, claim, streamingUrl, getFile, shouldHide) || thumbnail; + const thumbnailUrl = useGetThumbnail(uri, claim, streamingUrl, getFile, shouldHide); function handleContextMenu(e) { // @if TARGET='app' diff --git a/ui/effects/use-get-thumbnail.js b/ui/effects/use-get-thumbnail.js index 0b84fb53a..0a8a71350 100644 --- a/ui/effects/use-get-thumbnail.js +++ b/ui/effects/use-get-thumbnail.js @@ -18,7 +18,10 @@ export default function useGetThumbnail( let thumbnailToUse; // @if TARGET='web' - if (claim && isImage && isFree) { + const thumbnailInClaim = claim && claim.value && claim.value.thumbnail && claim.value.thumbnail.url; + if (thumbnailInClaim) { + thumbnailToUse = thumbnailInClaim; + } else if (claim && isImage && isFree) { thumbnailToUse = generateStreamUrl(claim.name, claim.claim_id); } // @endif