body parsing disable on feed

This commit is contained in:
feruz 2021-01-18 15:06:43 +02:00
parent 69a2f13e2e
commit 390d8b43fe
2 changed files with 7 additions and 6 deletions

View File

@ -457,7 +457,7 @@ export const getRankedPosts = async (query, currentUserName, filterNsfw) => {
let posts = await client.call('bridge', 'get_ranked_posts', query);
if (posts) {
posts = parsePosts(posts, currentUserName, true);
posts = parsePosts(posts, currentUserName);
if (filterNsfw !== '0') {
const updatedPosts = filterNsfwPost(posts, filterNsfw);
@ -475,7 +475,7 @@ export const getAccountPosts = async (query, currentUserName, filterNsfw) => {
let posts = await client.call('bridge', 'get_account_posts', query);
if (posts) {
posts = parsePosts(posts, currentUserName, true);
posts = parsePosts(posts, currentUserName);
if (filterNsfw !== '0') {
const updatedPosts = filterNsfwPost(posts, filterNsfw);

View File

@ -13,13 +13,13 @@ const webp = Platform.OS === 'ios' ? false : true;
export const parsePosts = (posts, currentUserName) => {
if (posts) {
const formattedPosts = posts.map((post) => parsePost(post, currentUserName));
const formattedPosts = posts.map((post) => parsePost(post, currentUserName, false, true));
return formattedPosts;
}
return null;
};
export const parsePost = (post, currentUserName, isPromoted) => {
export const parsePost = (post, currentUserName, isPromoted, isList = false) => {
if (!post) {
return null;
}
@ -36,8 +36,9 @@ export const parsePost = (post, currentUserName, isPromoted) => {
post.thumbnail = catchPostImage(post.body, 60, 50, webp ? 'webp' : 'match');
post.author_reputation = getReputation(post.author_reputation);
post.avatar = getResizedAvatar(get(post, 'author'));
post.body = renderPostBody(post, true, webp);
if (!isList) {
post.body = renderPostBody(post, true, webp);
}
post.summary = postBodySummary(post, 150);
post.is_declined_payout = parseAsset(post.max_accepted_payout).amount === 0;