fix claim preview blocking

This commit is contained in:
Sean Yesmunt 2019-07-05 14:11:55 -04:00
parent 0e1a501ba3
commit e7af386608

View file

@ -56,14 +56,19 @@ function ClaimPreview(props: Props) {
const abandoned = !isResolvingUri && !claim && !placeholder;
const { isChannel } = parseURI(uri);
const claimsInChannel = (claim && claim.meta.claims_in_channel) || 0;
const shouldHide =
abandoned ||
(!claimIsMine && obscureNsfw && nsfw) ||
(claim &&
blackListedOutpoints &&
blackListedOutpoints.reduce((hide, outpoint) => {
return hide || (outpoint.txid === claim.txid && outpoint.nout === claim.nout);
}));
let shouldHide = abandoned || (!claimIsMine && obscureNsfw && nsfw);
// This will be replaced once blocking is done at the wallet server level
if (claim && !shouldHide && blackListedOutpoints) {
for (let i = 0; i < blackListedOutpoints.length; i += 1) {
const outpoint = blackListedOutpoints[i];
if (outpoint.txid === claim.txid && outpoint.nout === claim.nout) {
shouldHide = true;
break;
}
}
}
function handleContextMenu(e) {
e.preventDefault();