mirror of
https://github.com/LBRYFoundation/lbry-desktop.git
synced 2025-08-23 17:47:24 +00:00
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,
|
doFileGet,
|
||||||
makeSelectChannelForClaimUri,
|
makeSelectChannelForClaimUri,
|
||||||
selectBlockedChannels,
|
selectBlockedChannels,
|
||||||
|
makeSelectClaimIsNsfw,
|
||||||
} from 'lbry-redux';
|
} from 'lbry-redux';
|
||||||
import { selectBlackListedOutpoints, selectFilteredOutpoints } from 'lbryinc';
|
import { selectBlackListedOutpoints, selectFilteredOutpoints } from 'lbryinc';
|
||||||
|
import { selectShowMatureContent } from 'redux/selectors/settings';
|
||||||
import ClaimPreviewTile from './view';
|
import ClaimPreviewTile from './view';
|
||||||
|
|
||||||
const select = (state, props) => ({
|
const select = (state, props) => ({
|
||||||
|
@ -21,6 +23,8 @@ const select = (state, props) => ({
|
||||||
blackListedOutpoints: selectBlackListedOutpoints(state),
|
blackListedOutpoints: selectBlackListedOutpoints(state),
|
||||||
filteredOutpoints: selectFilteredOutpoints(state),
|
filteredOutpoints: selectFilteredOutpoints(state),
|
||||||
blockedChannelUris: selectBlockedChannels(state),
|
blockedChannelUris: selectBlockedChannels(state),
|
||||||
|
showMature: selectShowMatureContent(state),
|
||||||
|
isMature: makeSelectClaimIsNsfw(props.uri)(state),
|
||||||
});
|
});
|
||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
|
|
|
@ -36,6 +36,8 @@ type Props = {
|
||||||
getFile: string => void,
|
getFile: string => void,
|
||||||
placeholder: boolean,
|
placeholder: boolean,
|
||||||
streamingUrl: string,
|
streamingUrl: string,
|
||||||
|
isMature: boolean,
|
||||||
|
showMature: boolean,
|
||||||
};
|
};
|
||||||
|
|
||||||
function ClaimPreviewTile(props: Props) {
|
function ClaimPreviewTile(props: Props) {
|
||||||
|
@ -53,6 +55,8 @@ function ClaimPreviewTile(props: Props) {
|
||||||
getFile,
|
getFile,
|
||||||
streamingUrl,
|
streamingUrl,
|
||||||
blockedChannelUris,
|
blockedChannelUris,
|
||||||
|
isMature,
|
||||||
|
showMature,
|
||||||
} = props;
|
} = props;
|
||||||
const isRepost = claim && claim.repost_channel_url;
|
const isRepost = claim && claim.repost_channel_url;
|
||||||
const shouldFetch = claim === undefined;
|
const shouldFetch = claim === undefined;
|
||||||
|
@ -100,6 +104,12 @@ function ClaimPreviewTile(props: Props) {
|
||||||
|
|
||||||
let shouldHide = false;
|
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
|
// This will be replaced once blocking is done at the wallet server level
|
||||||
if (claim && !shouldHide && blackListedOutpoints) {
|
if (claim && !shouldHide && blackListedOutpoints) {
|
||||||
shouldHide = blackListedOutpoints.some(
|
shouldHide = blackListedOutpoints.some(
|
||||||
|
|
Loading…
Add table
Reference in a new issue