ChannelThumbnail fixes #6075

Merged
infinite-persistence merged 4 commits from ip/reenable-channel-thumbnail-optimization into master 2021-05-17 21:51:21 +02:00
Showing only changes of commit faefb4c59c - Show all commits

View file

@ -67,7 +67,7 @@ function ChannelThumbnail(props: Props) {
}
}, [doResolveUri, shouldResolve, uri]);
useLazyLoading(thumbnailRef, 0.25, [showThumb]);
useLazyLoading(thumbnailRef, 0.25, [showThumb, thumbError, channelThumbnail]);
if (isGif && !allowGifs) {
return (
@ -99,7 +99,7 @@ function ChannelThumbnail(props: Props) {
ref={thumbnailRef}
alt={__('Channel profile picture')}
className="channel-thumbnail__default"
src={!thumbError && url ? url : Gerbil}
data-src={!thumbError && url ? url : Gerbil}
onError={() => setThumbError(true)} // if thumb fails (including due to https replace, show gerbil.
/>
)}
@ -112,7 +112,7 @@ function ChannelThumbnail(props: Props) {
ref={thumbnailRef}
alt={__('Channel profile picture')}
className="channel-thumbnail__custom"
src={!thumbError && url ? url : Gerbil}
data-src={!thumbError && url ? url : Gerbil}
onError={() => setThumbError(true)} // if thumb fails (including due to https replace, show gerbil.
/>
)}