Merge pull request #2008 from ecency/nt/meta-fix

NT - Meta Fix
This commit is contained in:
Feruz M 2021-07-26 12:10:10 +03:00 committed by GitHub
commit a6bdc6a809
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -82,6 +82,14 @@ export const parseComments = async (comments) => {
comment.markdownBody = get(comment, 'body'); comment.markdownBody = get(comment, 'body');
comment.body = renderPostBody(comment, true, webp); comment.body = renderPostBody(comment, true, webp);
//parse json meta;
if (typeof comment.json_metadata === 'string' || comment.json_metadata instanceof String) {
try {
comment.json_metadata = JSON.parse(comment.json_metadata);
} catch (error) {
comment.json_metadata = {};
}
}
//calculate and set total_payout to show to user. //calculate and set total_payout to show to user.
const totalPayout = const totalPayout =
parseAsset(comment.pending_payout_value).amount + parseAsset(comment.pending_payout_value).amount +