hide nsfw reposts until fix on sdk side
This commit is contained in:
parent
57e9013e97
commit
ba9e26a8cc
2 changed files with 14 additions and 0 deletions
|
@ -8,8 +8,10 @@ import {
|
|||
doFileGet,
|
||||
makeSelectChannelForClaimUri,
|
||||
selectBlockedChannels,
|
||||
makeSelectClaimIsNsfw,
|
||||
} from 'lbry-redux';
|
||||
import { selectBlackListedOutpoints, selectFilteredOutpoints } from 'lbryinc';
|
||||
import { selectShowMatureContent } from 'redux/selectors/settings';
|
||||
import ClaimPreviewTile from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
|
@ -21,6 +23,8 @@ const select = (state, props) => ({
|
|||
blackListedOutpoints: selectBlackListedOutpoints(state),
|
||||
filteredOutpoints: selectFilteredOutpoints(state),
|
||||
blockedChannelUris: selectBlockedChannels(state),
|
||||
showMature: selectShowMatureContent(state),
|
||||
isMature: makeSelectClaimIsNsfw(props.uri)(state),
|
||||
});
|
||||
|
||||
const perform = dispatch => ({
|
||||
|
|
|
@ -36,6 +36,8 @@ type Props = {
|
|||
getFile: string => void,
|
||||
placeholder: boolean,
|
||||
streamingUrl: string,
|
||||
isMature: boolean,
|
||||
showMature: boolean,
|
||||
};
|
||||
|
||||
function ClaimPreviewTile(props: Props) {
|
||||
|
@ -53,6 +55,8 @@ function ClaimPreviewTile(props: Props) {
|
|||
getFile,
|
||||
streamingUrl,
|
||||
blockedChannelUris,
|
||||
isMature,
|
||||
showMature,
|
||||
} = props;
|
||||
const isRepost = claim && claim.repost_channel_url;
|
||||
const shouldFetch = claim === undefined;
|
||||
|
@ -100,6 +104,12 @@ function ClaimPreviewTile(props: Props) {
|
|||
|
||||
let shouldHide = false;
|
||||
|
||||
if (isMature && !showMature) {
|
||||
// Unfortunately needed until this is resolved
|
||||
// https://github.com/lbryio/lbry-sdk/issues/2785
|
||||
shouldHide = true;
|
||||
}
|
||||
|
||||
// This will be replaced once blocking is done at the wallet server level
|
||||
if (claim && !shouldHide && blackListedOutpoints) {
|
||||
shouldHide = blackListedOutpoints.some(
|
||||
|
|
Loading…
Reference in a new issue