parent
cff17deb5d
commit
528a0f4d6e
2 changed files with 1 additions and 23 deletions
|
@ -3,7 +3,6 @@ import { makeSelectClaimForUri, selectIsUriResolving } from 'redux/selectors/cla
|
||||||
import { doResolveUri } from 'redux/actions/claims';
|
import { doResolveUri } from 'redux/actions/claims';
|
||||||
import { doSetPlayingUri } from 'redux/actions/content';
|
import { doSetPlayingUri } from 'redux/actions/content';
|
||||||
import { punctuationMarks } from 'util/remark-lbry';
|
import { punctuationMarks } from 'util/remark-lbry';
|
||||||
import { selectBlackListedOutpoints } from 'lbryinc';
|
|
||||||
import { selectPlayingUri } from 'redux/selectors/content';
|
import { selectPlayingUri } from 'redux/selectors/content';
|
||||||
import ClaimLink from './view';
|
import ClaimLink from './view';
|
||||||
|
|
||||||
|
@ -26,7 +25,6 @@ const select = (state, props) => {
|
||||||
claim,
|
claim,
|
||||||
fullUri: props.uri,
|
fullUri: props.uri,
|
||||||
isResolvingUri: selectIsUriResolving(state, uri),
|
isResolvingUri: selectIsUriResolving(state, uri),
|
||||||
blackListedOutpoints: selectBlackListedOutpoints(state),
|
|
||||||
playingUri: selectPlayingUri(state),
|
playingUri: selectPlayingUri(state),
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -14,10 +14,6 @@ type Props = {
|
||||||
description: ?string,
|
description: ?string,
|
||||||
isResolvingUri: boolean,
|
isResolvingUri: boolean,
|
||||||
doResolveUri: (string) => void,
|
doResolveUri: (string) => void,
|
||||||
blackListedOutpoints: Array<{
|
|
||||||
txid: string,
|
|
||||||
nout: number,
|
|
||||||
}>,
|
|
||||||
playingUri: ?PlayingUri,
|
playingUri: ?PlayingUri,
|
||||||
parentCommentId?: string,
|
parentCommentId?: string,
|
||||||
isMarkdownPost?: boolean,
|
isMarkdownPost?: boolean,
|
||||||
|
@ -42,21 +38,6 @@ class ClaimLink extends React.Component<Props> {
|
||||||
this.resolve(this.props);
|
this.resolve(this.props);
|
||||||
}
|
}
|
||||||
|
|
||||||
isClaimBlackListed() {
|
|
||||||
const { claim, blackListedOutpoints } = this.props;
|
|
||||||
const signingChannel = claim && claim.signing_channel;
|
|
||||||
if (claim && blackListedOutpoints) {
|
|
||||||
let blackListed = false;
|
|
||||||
|
|
||||||
blackListed = blackListedOutpoints.some(
|
|
||||||
(outpoint) =>
|
|
||||||
(signingChannel && outpoint.txid === signingChannel.txid && outpoint.nout === signingChannel.nout) ||
|
|
||||||
(outpoint.txid === claim.txid && outpoint.nout === claim.nout)
|
|
||||||
);
|
|
||||||
return blackListed;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
resolve = (props: Props) => {
|
resolve = (props: Props) => {
|
||||||
const { isResolvingUri, doResolveUri, claim, uri } = props;
|
const { isResolvingUri, doResolveUri, claim, uri } = props;
|
||||||
|
|
||||||
|
@ -78,14 +59,13 @@ class ClaimLink extends React.Component<Props> {
|
||||||
allowPreview,
|
allowPreview,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
const isUnresolved = (!isResolvingUri && !claim) || !claim;
|
const isUnresolved = (!isResolvingUri && !claim) || !claim;
|
||||||
const isBlacklisted = this.isClaimBlackListed();
|
|
||||||
const isPlayingInline =
|
const isPlayingInline =
|
||||||
playingUri &&
|
playingUri &&
|
||||||
playingUri.uri === uri &&
|
playingUri.uri === uri &&
|
||||||
((playingUri.source === 'comment' && parentCommentId === playingUri.commentId) ||
|
((playingUri.source === 'comment' && parentCommentId === playingUri.commentId) ||
|
||||||
playingUri.source === 'markdown');
|
playingUri.source === 'markdown');
|
||||||
|
|
||||||
if (isBlacklisted || isUnresolved) {
|
if (isUnresolved) {
|
||||||
return <span>{children}</span>;
|
return <span>{children}</span>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue