mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-17 10:21:33 +03:00
rendering comments html in profile comments and replies tabs
This commit is contained in:
parent
a85227d834
commit
dea9a6c80e
@ -522,7 +522,7 @@ export const getRankedPosts = async (query, currentUserName, filterNsfw) => {
|
||||
|
||||
if (posts) {
|
||||
const areComments = query.sort === 'comments' || query.sort === 'replies';
|
||||
posts = parsePosts(posts, currentUserName, areComments);
|
||||
posts = areComments ? parseComments(posts) : parsePosts(posts, currentUserName);
|
||||
|
||||
if (filterNsfw !== '0') {
|
||||
const updatedPosts = filterNsfwPost(posts, filterNsfw);
|
||||
@ -543,7 +543,7 @@ export const getAccountPosts = async (query, currentUserName, filterNsfw) => {
|
||||
|
||||
if (posts) {
|
||||
const areComments = query.sort === 'comments' || query.sort === 'replies';
|
||||
posts = parsePosts(posts, currentUserName, areComments);
|
||||
posts = areComments ? parseComments(posts) : parsePosts(posts, currentUserName);
|
||||
|
||||
if (filterNsfw !== '0') {
|
||||
const updatedPosts = filterNsfwPost(posts, filterNsfw);
|
||||
|
@ -12,17 +12,17 @@ import { parseReputation } from './user';
|
||||
|
||||
const webp = Platform.OS === 'ios' ? false : true;
|
||||
|
||||
export const parsePosts = (posts, currentUserName, areComments) => {
|
||||
export const parsePosts = (posts, currentUserName) => {
|
||||
if (posts) {
|
||||
const formattedPosts = posts.map((post) =>
|
||||
parsePost(post, currentUserName, false, true, areComments),
|
||||
parsePost(post, currentUserName, false, true),
|
||||
);
|
||||
return formattedPosts;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
export const parsePost = (post, currentUserName, isPromoted, isList = false, isComment = false) => {
|
||||
export const parsePost = (post, currentUserName, isPromoted, isList = false) => {
|
||||
if (!post) {
|
||||
return null;
|
||||
}
|
||||
@ -62,7 +62,7 @@ export const parsePost = (post, currentUserName, isPromoted, isList = false, isC
|
||||
post.post_fetched_at = new Date().getTime();
|
||||
|
||||
//discard post body if list
|
||||
if (isList && !isComment) {
|
||||
if (isList) {
|
||||
post.body = '';
|
||||
}
|
||||
|
||||
@ -120,7 +120,7 @@ export const parseCommentThreads = async (commentsMap:any, author:string, permli
|
||||
|
||||
|
||||
|
||||
export const parseComments = async (comments:any[]) => {
|
||||
export const parseComments = (comments:any[]) => {
|
||||
if(!comments){
|
||||
return null;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user