Remove blacklist.
This commit is contained in:
parent
f822232642
commit
63b19a92aa
4 changed files with 13 additions and 53 deletions
extras/lbryinc
ui
|
@ -39,10 +39,6 @@ export {
|
||||||
selectAllCostInfoByUri,
|
selectAllCostInfoByUri,
|
||||||
selectFetchingCostInfo,
|
selectFetchingCostInfo,
|
||||||
} from './redux/selectors/cost_info';
|
} from './redux/selectors/cost_info';
|
||||||
export {
|
|
||||||
selectBlackListedOutpoints,
|
|
||||||
selectBlacklistedOutpointMap,
|
|
||||||
} from './redux/selectors/blacklist';
|
|
||||||
export {
|
export {
|
||||||
selectViewCount,
|
selectViewCount,
|
||||||
selectViewCountForUri,
|
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,
|
makeSelectMetadataItemForUri,
|
||||||
} from 'redux/selectors/claims';
|
} from 'redux/selectors/claims';
|
||||||
import { doResolveUri } from 'redux/actions/claims';
|
import { doResolveUri } from 'redux/actions/claims';
|
||||||
import { selectBlackListedOutpoints } from 'lbryinc';
|
|
||||||
import PreviewLink from './view';
|
import PreviewLink from './view';
|
||||||
|
|
||||||
const select = (state, props) => {
|
const select = (state, props) => {
|
||||||
|
@ -22,7 +21,6 @@ const select = (state, props) => {
|
||||||
description: makeSelectMetadataItemForUri(props.uri, 'description')(state),
|
description: makeSelectMetadataItemForUri(props.uri, 'description')(state),
|
||||||
channelIsMine: selectClaimIsMine(state, claim),
|
channelIsMine: selectClaimIsMine(state, claim),
|
||||||
isResolvingUri: selectIsUriResolving(state, props.uri),
|
isResolvingUri: selectIsUriResolving(state, props.uri),
|
||||||
blackListedOutpoints: selectBlackListedOutpoints(state),
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@ import { selectSupportsByOutpoint } from 'redux/selectors/wallet';
|
||||||
import { createSelector } from 'reselect';
|
import { createSelector } from 'reselect';
|
||||||
import { createCachedSelector } from 're-reselect';
|
import { createCachedSelector } from 're-reselect';
|
||||||
import { isClaimNsfw, filterClaims } from 'util/claim';
|
import { isClaimNsfw, filterClaims } from 'util/claim';
|
||||||
import { selectBlackListedOutpoints } from 'lbryinc';
|
|
||||||
import * as CLAIM from 'constants/claim';
|
import * as CLAIM from 'constants/claim';
|
||||||
|
|
||||||
type State = { claims: any };
|
type State = { claims: any };
|
||||||
|
@ -96,33 +95,20 @@ export const makeSelectClaimErrorCensor = (claimUri: string) =>
|
||||||
createSelector(selectState, (state) => state.blacklistedByUri[claimUri]);
|
createSelector(selectState, (state) => state.blacklistedByUri[claimUri]);
|
||||||
|
|
||||||
export const makeSelectIsBlacklisted = (claimUri: string) =>
|
export const makeSelectIsBlacklisted = (claimUri: string) =>
|
||||||
createSelector(
|
createSelector(makeSelectClaimErrorCensor(claimUri), makeSelectClaimForUri(claimUri), (errorCensor, claim) => {
|
||||||
makeSelectClaimErrorCensor(claimUri),
|
if (errorCensor) {
|
||||||
selectBlackListedOutpoints,
|
return true;
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
);
|
// 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]);
|
export const makeSelectClaimForClaimId = (claimId: string) => createSelector(selectClaimsById, (byId) => byId[claimId]);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue