From b231b1a51f98cd72326ca79f2b7ec12c1a04f398 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Thu, 18 Feb 2021 16:33:55 -0500 Subject: [PATCH] use cdn for channel thumbnails --- ui/component/channelThumbnail/view.jsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/ui/component/channelThumbnail/view.jsx b/ui/component/channelThumbnail/view.jsx index d3af5c508..129565416 100644 --- a/ui/component/channelThumbnail/view.jsx +++ b/ui/component/channelThumbnail/view.jsx @@ -5,6 +5,7 @@ import classnames from 'classnames'; import Gerbil from './gerbil.png'; import FreezeframeWrapper from 'component/fileThumbnail/FreezeframeWrapper'; import ChannelStakedIndicator from 'component/channelStakedIndicator'; +import { getThumbnailCdnUrl } from 'util/thumbnail'; type Props = { thumbnail: ?string, @@ -67,6 +68,14 @@ function ChannelThumbnail(props: Props) { ); } + let url = channelThumbnail; + // @if TARGET='web' + // Pass image urls through a compression proxy + if (thumbnail) { + url = getThumbnailCdnUrl({ thumbnail }); + } + // @endif + return (
setThumbError(true)} // if thumb fails (including due to https replace, show gerbil. /> )} @@ -91,7 +100,7 @@ function ChannelThumbnail(props: Props) { {__('Channel setThumbError(true)} // if thumb fails (including due to https replace, show gerbil. /> )}