Fix first claim nsfw result being hidden even if nsfw is enabled

This commit is contained in:
Franco Montenegro 2021-01-26 13:55:27 -03:00 committed by Sean Yesmunt
parent a178cdba08
commit 10a83bbfe9
2 changed files with 5 additions and 2 deletions

View file

@ -22,7 +22,7 @@ const select = (state, props) => ({
pending: props.uri && makeSelectClaimIsPending(props.uri)(state),
claim: props.uri && makeSelectClaimForUri(props.uri)(state),
reflectingProgress: props.uri && makeSelectReflectingClaimForUri(props.uri)(state),
obscureNsfw: !selectShowMatureContent(state),
obscureNsfw: selectShowMatureContent(state) === false,
claimIsMine: props.uri && makeSelectClaimIsMine(props.uri)(state),
isResolvingUri: props.uri && makeSelectIsUriResolving(props.uri)(state),
isResolvingRepost: props.uri && makeSelectIsUriResolving(props.repostUrl)(state),

View file

@ -81,6 +81,7 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
getFile,
resolveUri,
// claim properties
// is the claim consider nsfw?
nsfw,
claimIsMine,
isSubscribed,
@ -100,6 +101,8 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
// modifiers
customShouldHide,
showNullPlaceholder,
// value from show mature content user setting
// true if the user doesn't wanna see nsfw content
obscureNsfw,
showUserBlocked,
showUnresolvedClaim,
@ -220,7 +223,7 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
return <ClaimPreviewLoading isChannel={isChannelUri} type={type} />;
}
if (claim && showNullPlaceholder && shouldHide && nsfw) {
if (claim && showNullPlaceholder && shouldHide && nsfw && obscureNsfw) {
return (
<ClaimPreviewHidden
message={__('Mature content hidden by your preferences')}