Merge pull request #1916 from ecency/nt/nsfw-fix

patched nsfw leak
This commit is contained in:
Feruz M 2021-04-12 21:09:05 +03:00 committed by GitHub
commit e8972ff002
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 5 deletions

View File

@ -114,7 +114,7 @@ const PostCardContainer = ({
handleOnReblogsPress={_handleOnReblogsPress} handleOnReblogsPress={_handleOnReblogsPress}
content={content} content={content}
isHideImage={isHideImage} isHideImage={isHideImage}
isNsfwPost={nsfw || '1'} nsfw={nsfw || '1'}
reblogs={reblogs} reblogs={reblogs}
activeVotes={activeVotes} activeVotes={activeVotes}
imageHeight={imageHeight} imageHeight={imageHeight}

View File

@ -34,7 +34,7 @@ const PostCardView = ({
reblogs, reblogs,
isHideImage, isHideImage,
fetchPost, fetchPost,
isNsfwPost, nsfw,
intl, intl,
activeVotes, activeVotes,
imageHeight, imageHeight,
@ -77,11 +77,11 @@ const PostCardView = ({
const rebloggedBy = get(content, 'reblogged_by[0]', null); const rebloggedBy = get(content, 'reblogged_by[0]', null);
var images = { image: DEFAULT_IMAGE, thumbnail: DEFAULT_IMAGE }; var images = { image: DEFAULT_IMAGE, thumbnail: DEFAULT_IMAGE };
if (content.thumbnail) { if (content.thumbnail) {
if (isNsfwPost && content.nsfw) { if (nsfw !== '0' && content.nsfw) {
images = { image: NSFW_IMAGE, thumbnail: NSFW_IMAGE }; images = { image: NSFW_IMAGE, thumbnail: NSFW_IMAGE };
} else {
images = { image: content.image, thumbnail: content.thumbnail };
} }
images = { image: content.image, thumbnail: content.thumbnail };
} else { } else {
images = { image: DEFAULT_IMAGE, thumbnail: DEFAULT_IMAGE }; images = { image: DEFAULT_IMAGE, thumbnail: DEFAULT_IMAGE };
} }

View File

@ -11,6 +11,7 @@ export default (posts, option) => {
return posts; return posts;
} }
//removes nsfw post from array ... filter value '2'
if (posts) { if (posts) {
posts.map((post) => { posts.map((post) => {
if ( if (