fix thumbnails on desktop
This commit is contained in:
parent
48a707f0db
commit
78422ccfb2
2 changed files with 12 additions and 10 deletions
|
@ -1201,5 +1201,6 @@
|
||||||
"LBRY takes privacy and choice seriously. Just a few questions before you enter the land of content freedom. ": "LBRY takes privacy and choice seriously. Just a few questions before you enter the land of content freedom. ",
|
"LBRY takes privacy and choice seriously. Just a few questions before you enter the land of content freedom. ": "LBRY takes privacy and choice seriously. Just a few questions before you enter the land of content freedom. ",
|
||||||
"Sending information to third parties (e.g. Google Analytics or Mixpanel) allows us to use detailed\n analytical reports to improve all aspects of LBRY.": "Sending information to third parties (e.g. Google Analytics or Mixpanel) allows us to use detailed\n analytical reports to improve all aspects of LBRY.",
|
"Sending information to third parties (e.g. Google Analytics or Mixpanel) allows us to use detailed\n analytical reports to improve all aspects of LBRY.": "Sending information to third parties (e.g. Google Analytics or Mixpanel) allows us to use detailed\n analytical reports to improve all aspects of LBRY.",
|
||||||
"Sharing information with LBRY, Inc. allows us to report to publishers how their content is doing, as\n well as track basic usage and performance. This is the minimum required to earn rewards from LBRY, Inc.": "Sharing information with LBRY, Inc. allows us to report to publishers how their content is doing, as\n well as track basic usage and performance. This is the minimum required to earn rewards from LBRY, Inc.",
|
"Sharing information with LBRY, Inc. allows us to report to publishers how their content is doing, as\n well as track basic usage and performance. This is the minimum required to earn rewards from LBRY, Inc.": "Sharing information with LBRY, Inc. allows us to report to publishers how their content is doing, as\n well as track basic usage and performance. This is the minimum required to earn rewards from LBRY, Inc.",
|
||||||
"No information will be sent directly to LBRY, Inc. or third-parties about your usage. Note that as\n peer-to-peer software, your IP address and potentially other system information can be sent to other\n users, though this information is not stored permanently.": "No information will be sent directly to LBRY, Inc. or third-parties about your usage. Note that as\n peer-to-peer software, your IP address and potentially other system information can be sent to other\n users, though this information is not stored permanently."
|
"No information will be sent directly to LBRY, Inc. or third-parties about your usage. Note that as\n peer-to-peer software, your IP address and potentially other system information can be sent to other\n users, though this information is not stored permanently.": "No information will be sent directly to LBRY, Inc. or third-parties about your usage. Note that as\n peer-to-peer software, your IP address and potentially other system information can be sent to other\n users, though this information is not stored permanently.",
|
||||||
}
|
"%view_count% Views": "%view_count% Views"
|
||||||
|
}
|
|
@ -9,16 +9,15 @@ export default function useGetThumbnail(
|
||||||
getFile: string => void,
|
getFile: string => void,
|
||||||
shouldHide: boolean
|
shouldHide: boolean
|
||||||
) {
|
) {
|
||||||
// const hasClaim = claim !== undefined;
|
let thumbnailToUse;
|
||||||
|
|
||||||
// $FlowFixMe
|
// $FlowFixMe
|
||||||
const isImage = claim && claim.value && claim.value.stream_type === 'image';
|
const isImage = claim && claim.value && claim.value.stream_type === 'image';
|
||||||
// $FlowFixMe
|
// $FlowFixMe
|
||||||
const isFree = claim && claim.value && (!claim.value.fee || Number(claim.value.fee.amount) <= 0);
|
const isFree = claim && claim.value && (!claim.value.fee || Number(claim.value.fee.amount) <= 0);
|
||||||
let thumbnailToUse;
|
const thumbnailInClaim = claim && claim.value && claim.value.thumbnail && claim.value.thumbnail.url;
|
||||||
|
|
||||||
// @if TARGET='web'
|
// @if TARGET='web'
|
||||||
const thumbnailInClaim = claim && claim.value && claim.value.thumbnail && claim.value.thumbnail.url;
|
|
||||||
if (thumbnailInClaim) {
|
if (thumbnailInClaim) {
|
||||||
thumbnailToUse = thumbnailInClaim;
|
thumbnailToUse = thumbnailInClaim;
|
||||||
} else if (claim && isImage && isFree) {
|
} else if (claim && isImage && isFree) {
|
||||||
|
@ -26,12 +25,9 @@ export default function useGetThumbnail(
|
||||||
}
|
}
|
||||||
// @endif
|
// @endif
|
||||||
|
|
||||||
const [thumbnail, setThumbnail] = React.useState(thumbnailToUse);
|
|
||||||
React.useEffect(() => {
|
|
||||||
setThumbnail(thumbnailToUse);
|
|
||||||
}, [thumbnailToUse]);
|
|
||||||
|
|
||||||
// @if TARGET='app'
|
// @if TARGET='app'
|
||||||
|
thumbnailToUse = thumbnailInClaim;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Temporarily disabled until we can call get with "save_blobs: off"
|
// Temporarily disabled until we can call get with "save_blobs: off"
|
||||||
//
|
//
|
||||||
|
@ -46,5 +42,10 @@ export default function useGetThumbnail(
|
||||||
// }, [hasClaim, isFree, isImage, streamingUrl, uri, shouldHide]);
|
// }, [hasClaim, isFree, isImage, streamingUrl, uri, shouldHide]);
|
||||||
// @endif
|
// @endif
|
||||||
|
|
||||||
|
const [thumbnail, setThumbnail] = React.useState(thumbnailToUse);
|
||||||
|
React.useEffect(() => {
|
||||||
|
setThumbnail(thumbnailToUse);
|
||||||
|
}, [thumbnailToUse]);
|
||||||
|
|
||||||
return thumbnail;
|
return thumbnail;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue