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}
content={content}
isHideImage={isHideImage}
isNsfwPost={nsfw || '1'}
nsfw={nsfw || '1'}
reblogs={reblogs}
activeVotes={activeVotes}
imageHeight={imageHeight}

View File

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

View File

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