From 564281948865fb3be3d738ee3088e9d5e648e396 Mon Sep 17 00:00:00 2001 From: Nouman Tahir Date: Fri, 9 Jul 2021 21:31:16 +0500 Subject: [PATCH 1/4] 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(); From 06ea7e6bc4cf7349ceae46fc353f559dd631772f Mon Sep 17 00:00:00 2001 From: Nouman Tahir Date: Fri, 9 Jul 2021 21:31:55 +0500 Subject: [PATCH 2/4] fixed issue with upvote downvote local cache swap not updating ui --- src/components/upvote/container/upvoteContainer.js | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/components/upvote/container/upvoteContainer.js b/src/components/upvote/container/upvoteContainer.js index fedc01d38..41c3062db 100644 --- a/src/components/upvote/container/upvoteContainer.js +++ b/src/components/upvote/container/upvoteContainer.js @@ -87,11 +87,8 @@ const UpvoteContainer = (props) => { incrementVoteCount(); } - if (isDownvote) { - setIsDownVoted(true); - } else { - setIsVoted(true); - } + setIsDownVoted(isDownvote ? true : false); + setIsVoted(isDownvote ? false : true); } }; @@ -105,11 +102,8 @@ const UpvoteContainer = (props) => { incrementVoteCount(); } - if (isDownvote) { - setIsDownVoted(true); - } else { - setIsVoted(true); - } + setIsDownVoted(isDownvote ? true : false); + setIsVoted(isDownvote ? false : true); setTotalPayout(totalPayout + amountNum); //update redux From 9befde93ae1b1a2aadd80084c4e471811d2f10b5 Mon Sep 17 00:00:00 2001 From: Nouman Tahir Date: Fri, 9 Jul 2021 21:32:16 +0500 Subject: [PATCH 3/4] lint fix --- src/containers/profileContainer.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/containers/profileContainer.js b/src/containers/profileContainer.js index 7f102ac56..48a324814 100644 --- a/src/containers/profileContainer.js +++ b/src/containers/profileContainer.js @@ -260,6 +260,7 @@ class ProfileContainer extends Component { }; _fetchProfile = async (username = null, isProfileAction = false) => { + const { intl } = this.props; try { const { username: _username, isFollowing, isMuted, isOwnProfile } = this.state; From d4ef198b9c64459f04819f05d28f06b85ef5cea3 Mon Sep 17 00:00:00 2001 From: Nouman Tahir Date: Fri, 9 Jul 2021 21:48:38 +0500 Subject: [PATCH 4/4] added failure message if image picker failed for other reason than permission so you user dont wait for upload to finish --- src/screens/editor/container/editorContainer.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/screens/editor/container/editorContainer.js b/src/screens/editor/container/editorContainer.js index 3efd7ccbf..bb0d73b55 100644 --- a/src/screens/editor/container/editorContainer.js +++ b/src/screens/editor/container/editorContainer.js @@ -435,6 +435,13 @@ class EditorContainer extends Component { id: 'alert.permission_text', }), ); + }else{ + Alert.alert( + intl.formatMessage({ + id: 'alert.fail', + }), + error.message, + ); } };