From 6d46686e7efcce711f10aebf7b694d6ac85806ae Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Wed, 8 Jan 2020 11:36:49 -0500 Subject: [PATCH] block spee.ch thumbnails --- ui/component/claimList/view.jsx | 10 ++++++++++ ui/component/claimPreview/view.jsx | 8 ++++++++ 2 files changed, 18 insertions(+) diff --git a/ui/component/claimList/view.jsx b/ui/component/claimList/view.jsx index 6e9946ca9..62600c603 100644 --- a/ui/component/claimList/view.jsx +++ b/ui/component/claimList/view.jsx @@ -132,6 +132,16 @@ export default function ClaimList(props: Props) { type={type} properties={type !== 'small' ? undefined : false} showUserBlocked={showHiddenByUser} + customShouldHide={(claim: StreamClaim) => { + // Hack to hide spee.ch thumbnail publishes + // If it meets these requirements, it was probably uploaded here: + // https://github.com/lbryio/lbry-redux/blob/master/src/redux/actions/publish.js#L74-L79 + if (claim.name.length === 24 && !claim.name.includes(' ') && claim.value.author === 'Spee.ch') { + return true; + } else { + return false; + } + }} /> ))} diff --git a/ui/component/claimPreview/view.jsx b/ui/component/claimPreview/view.jsx index 4ea45f3fc..35d3a69b1 100644 --- a/ui/component/claimPreview/view.jsx +++ b/ui/component/claimPreview/view.jsx @@ -53,6 +53,7 @@ type Props = { hideBlock?: boolean, streamingUrl: ?string, getFile: string => void, + customShouldHide?: Claim => boolean, }; const ClaimPreview = forwardRef((props: Props, ref: any) => { @@ -84,6 +85,7 @@ const ClaimPreview = forwardRef((props: Props, ref: any) => { hideBlock, getFile, streamingUrl, + customShouldHide, } = props; const shouldFetch = claim === undefined || (claim !== null && claim.value_type === 'channel' && isEmpty(claim.meta) && !pending); @@ -141,6 +143,12 @@ const ClaimPreview = forwardRef((props: Props, ref: any) => { shouldHide = blockedChannelUris.some(blockedUri => blockedUri === claim.permanent_url); } + if (!shouldHide && customShouldHide && claim) { + if (customShouldHide(claim)) { + shouldHide = true; + } + } + function handleContextMenu(e) { // @if TARGET='app' e.preventDefault();