block spee.ch thumbnails
This commit is contained in:
parent
c29be5b7ec
commit
6d46686e7e
2 changed files with 18 additions and 0 deletions
|
@ -132,6 +132,16 @@ export default function ClaimList(props: Props) {
|
||||||
type={type}
|
type={type}
|
||||||
properties={type !== 'small' ? undefined : false}
|
properties={type !== 'small' ? undefined : false}
|
||||||
showUserBlocked={showHiddenByUser}
|
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;
|
||||||
|
}
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -53,6 +53,7 @@ type Props = {
|
||||||
hideBlock?: boolean,
|
hideBlock?: boolean,
|
||||||
streamingUrl: ?string,
|
streamingUrl: ?string,
|
||||||
getFile: string => void,
|
getFile: string => void,
|
||||||
|
customShouldHide?: Claim => boolean,
|
||||||
};
|
};
|
||||||
|
|
||||||
const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||||
|
@ -84,6 +85,7 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||||
hideBlock,
|
hideBlock,
|
||||||
getFile,
|
getFile,
|
||||||
streamingUrl,
|
streamingUrl,
|
||||||
|
customShouldHide,
|
||||||
} = props;
|
} = props;
|
||||||
const shouldFetch =
|
const shouldFetch =
|
||||||
claim === undefined || (claim !== null && claim.value_type === 'channel' && isEmpty(claim.meta) && !pending);
|
claim === undefined || (claim !== null && claim.value_type === 'channel' && isEmpty(claim.meta) && !pending);
|
||||||
|
@ -141,6 +143,12 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||||
shouldHide = blockedChannelUris.some(blockedUri => blockedUri === claim.permanent_url);
|
shouldHide = blockedChannelUris.some(blockedUri => blockedUri === claim.permanent_url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!shouldHide && customShouldHide && claim) {
|
||||||
|
if (customShouldHide(claim)) {
|
||||||
|
shouldHide = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function handleContextMenu(e) {
|
function handleContextMenu(e) {
|
||||||
// @if TARGET='app'
|
// @if TARGET='app'
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
Loading…
Add table
Reference in a new issue