mirror of
https://github.com/ecency/ecency-mobile.git
synced 2025-01-03 11:34:30 +03:00
21 lines
475 B
JavaScript
21 lines
475 B
JavaScript
export default (posts, option) => {
|
|
const updatedPosts = [];
|
|
if (option === '1') {
|
|
posts.map(post => {
|
|
if (post.parent_permlink === 'nsfw' || post.json_metadata.tags.includes('nsfw')) {
|
|
post.nsfw = true;
|
|
}
|
|
});
|
|
return posts;
|
|
}
|
|
|
|
if (posts) {
|
|
posts.map(post => {
|
|
if (post.parent_permlink !== 'nsfw' && !post.json_metadata.tags.includes('nsfw')) {
|
|
updatedPosts.push(post);
|
|
}
|
|
});
|
|
return updatedPosts;
|
|
}
|
|
};
|