mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-19 03:11:38 +03:00
skipping body removal for comments list
This commit is contained in:
parent
b102e149a7
commit
7222075bf7
@ -462,9 +462,8 @@ export const getRankedPosts = async (query, currentUserName, filterNsfw) => {
|
||||
let posts = await client.call('bridge', 'get_ranked_posts', query);
|
||||
|
||||
if (posts) {
|
||||
posts = parsePosts(posts, currentUserName);
|
||||
|
||||
// FastImage.preload(posts.map(post=>({uri:post.image})))
|
||||
const areComments = query.sort === 'comments';
|
||||
posts = parsePosts(posts, currentUserName, areComments);
|
||||
|
||||
if (filterNsfw !== '0') {
|
||||
const updatedPosts = filterNsfwPost(posts, filterNsfw);
|
||||
@ -484,9 +483,8 @@ export const getAccountPosts = async (query, currentUserName, filterNsfw) => {
|
||||
let posts = await client.call('bridge', 'get_account_posts', query);
|
||||
|
||||
if (posts) {
|
||||
posts = parsePosts(posts, currentUserName);
|
||||
|
||||
// FastImage.preload(posts.map(post=>({uri:post.image})))
|
||||
const areComments = query.sort === 'comments';
|
||||
posts = parsePosts(posts, currentUserName, areComments);
|
||||
|
||||
if (filterNsfw !== '0') {
|
||||
const updatedPosts = filterNsfwPost(posts, filterNsfw);
|
||||
|
@ -12,15 +12,17 @@ import { getResizedAvatar, getResizedImage } from './image';
|
||||
|
||||
const webp = Platform.OS === 'ios' ? false : true;
|
||||
|
||||
export const parsePosts = (posts, currentUserName) => {
|
||||
export const parsePosts = (posts, currentUserName, areComments) => {
|
||||
if (posts) {
|
||||
const formattedPosts = posts.map((post) => parsePost(post, currentUserName, false, true));
|
||||
const formattedPosts = posts.map((post) =>
|
||||
parsePost(post, currentUserName, false, true, areComments),
|
||||
);
|
||||
return formattedPosts;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
export const parsePost = (post, currentUserName, isPromoted, isList = false) => {
|
||||
export const parsePost = (post, currentUserName, isPromoted, isList = false, isComment = false) => {
|
||||
if (!post) {
|
||||
return null;
|
||||
}
|
||||
@ -63,7 +65,7 @@ export const parsePost = (post, currentUserName, isPromoted, isList = false) =>
|
||||
post.post_fetched_at = new Date().getTime();
|
||||
|
||||
//discard post body if list
|
||||
if (isList) {
|
||||
if (isList && !isComment) {
|
||||
post.body = '';
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user