Remove blacklist.
This commit is contained in:
parent
f822232642
commit
63b19a92aa
4 changed files with 13 additions and 53 deletions
|
@ -39,10 +39,6 @@ export {
|
|||
selectAllCostInfoByUri,
|
||||
selectFetchingCostInfo,
|
||||
} from './redux/selectors/cost_info';
|
||||
export {
|
||||
selectBlackListedOutpoints,
|
||||
selectBlacklistedOutpointMap,
|
||||
} from './redux/selectors/blacklist';
|
||||
export {
|
||||
selectViewCount,
|
||||
selectViewCountForUri,
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
import { createSelector } from 'reselect';
|
||||
|
||||
export const selectState = state => state.blacklist || {};
|
||||
|
||||
export const selectBlackListedOutpoints = createSelector(
|
||||
selectState,
|
||||
state => state.blackListedOutpoints
|
||||
);
|
||||
|
||||
export const selectBlacklistedOutpointMap = createSelector(
|
||||
selectBlackListedOutpoints,
|
||||
outpoints =>
|
||||
outpoints
|
||||
? outpoints.reduce((acc, val) => {
|
||||
const outpoint = `${val.txid}:${val.nout}`;
|
||||
acc[outpoint] = 1;
|
||||
return acc;
|
||||
}, {})
|
||||
: {}
|
||||
);
|
|
@ -8,7 +8,6 @@ import {
|
|||
makeSelectMetadataItemForUri,
|
||||
} from 'redux/selectors/claims';
|
||||
import { doResolveUri } from 'redux/actions/claims';
|
||||
import { selectBlackListedOutpoints } from 'lbryinc';
|
||||
import PreviewLink from './view';
|
||||
|
||||
const select = (state, props) => {
|
||||
|
@ -22,7 +21,6 @@ const select = (state, props) => {
|
|||
description: makeSelectMetadataItemForUri(props.uri, 'description')(state),
|
||||
channelIsMine: selectClaimIsMine(state, claim),
|
||||
isResolvingUri: selectIsUriResolving(state, props.uri),
|
||||
blackListedOutpoints: selectBlackListedOutpoints(state),
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@ import { selectSupportsByOutpoint } from 'redux/selectors/wallet';
|
|||
import { createSelector } from 'reselect';
|
||||
import { createCachedSelector } from 're-reselect';
|
||||
import { isClaimNsfw, filterClaims } from 'util/claim';
|
||||
import { selectBlackListedOutpoints } from 'lbryinc';
|
||||
import * as CLAIM from 'constants/claim';
|
||||
|
||||
type State = { claims: any };
|
||||
|
@ -96,33 +95,20 @@ export const makeSelectClaimErrorCensor = (claimUri: string) =>
|
|||
createSelector(selectState, (state) => state.blacklistedByUri[claimUri]);
|
||||
|
||||
export const makeSelectIsBlacklisted = (claimUri: string) =>
|
||||
createSelector(
|
||||
makeSelectClaimErrorCensor(claimUri),
|
||||
selectBlackListedOutpoints,
|
||||
makeSelectClaimForUri(claimUri),
|
||||
(errorCensor, legacyBlacklistedList, claim) => {
|
||||
if (errorCensor) {
|
||||
return true;
|
||||
}
|
||||
// Fallback to legacy just in case.
|
||||
if (!claim) {
|
||||
return false;
|
||||
}
|
||||
if (!legacyBlacklistedList) {
|
||||
return false;
|
||||
}
|
||||
const signingChannel = claim.signing_channel;
|
||||
if (!signingChannel) {
|
||||
return false;
|
||||
}
|
||||
const isInLegacyBlacklist = legacyBlacklistedList.some(
|
||||
(outpoint) =>
|
||||
(signingChannel && outpoint.txid === signingChannel.txid && outpoint.nout === signingChannel.nout) ||
|
||||
(outpoint.txid === claim.txid && outpoint.nout === claim.nout)
|
||||
);
|
||||
return isInLegacyBlacklist;
|
||||
createSelector(makeSelectClaimErrorCensor(claimUri), makeSelectClaimForUri(claimUri), (errorCensor, claim) => {
|
||||
if (errorCensor) {
|
||||
return true;
|
||||
}
|
||||
);
|
||||
// Fallback to legacy just in case.
|
||||
if (!claim) {
|
||||
return false;
|
||||
}
|
||||
const signingChannel = claim.signing_channel;
|
||||
if (!signingChannel) {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
export const makeSelectClaimForClaimId = (claimId: string) => createSelector(selectClaimsById, (byId) => byId[claimId]);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue