From 564281948865fb3be3d738ee3088e9d5e648e396 Mon Sep 17 00:00:00 2001 From: Nouman Tahir Date: Fri, 9 Jul 2021 21:31:16 +0500 Subject: [PATCH] fixed issue wiht comment parser total value --- src/utils/postParser.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/utils/postParser.js b/src/utils/postParser.js index 2ec7c67a0..966643dd9 100644 --- a/src/utils/postParser.js +++ b/src/utils/postParser.js @@ -82,6 +82,14 @@ export const parseComments = async (comments) => { comment.markdownBody = get(comment, 'body'); comment.body = renderPostBody(comment, true, webp); + //calculate and set total_payout to show to user. + const totalPayout = + parseAsset(comment.pending_payout_value).amount + + parseAsset(comment.author_payout_value).amount + + parseAsset(comment.curator_payout_value).amount; + + comment.total_payout = totalPayout; + //stamp comments with fetched time; comment.post_fetched_at = new Date().getTime();