From 9578dfa4fd1df4dace57294c9ca7966c538a357f Mon Sep 17 00:00:00 2001 From: Mustafa Buyukcelebi Date: Fri, 23 Aug 2019 11:01:15 +0300 Subject: [PATCH] Comment changes --- .../upvote/container/upvoteContainer.js | 12 ++++++------ src/components/upvote/view/upvoteView.js | 18 +++++------------- src/utils/postParser.js | 2 +- 3 files changed, 12 insertions(+), 20 deletions(-) diff --git a/src/components/upvote/container/upvoteContainer.js b/src/components/upvote/container/upvoteContainer.js index 93f5ae55b..f597fa381 100644 --- a/src/components/upvote/container/upvoteContainer.js +++ b/src/components/upvote/container/upvoteContainer.js @@ -53,12 +53,12 @@ class UpvoteContainer extends PureComponent { } = this.props; const author = get(content, 'author'); - const isVoted = get(content, 'is_voted') - ? parseInt(get(content, 'is_voted'), 10) / 10000 - : false; - const isDownVoted = get(content, 'is_down_voted') - ? (parseInt(get(content, 'is_down_voted', false), 10) / 10000) * -1 - : false; + const isVoted = + get(content, 'is_voted', false) && parseInt(get(content, 'is_voted'), 10) / 10000; + const isDownVoted = + get(content, 'is_down_voted', false) && + (parseInt(get(content, 'is_down_voted'), 10) / 10000) * -1; + const totalPayout = get(content, 'total_payout'); const isDecinedPayout = get(content, 'is_declined_payout'); const permlink = get(content, 'permlink'); diff --git a/src/components/upvote/view/upvoteView.js b/src/components/upvote/view/upvoteView.js index 1ea4ef520..6297f77b8 100644 --- a/src/components/upvote/view/upvoteView.js +++ b/src/components/upvote/view/upvoteView.js @@ -224,7 +224,7 @@ class UpvoteView extends Component { const _percent = `${downvote ? '-' : ''}${(sliderValue * 100).toFixed(0)}%`; const _amount = `$${amount}`; const _totalPayout = totalPayout || '0.000'; - const _sliderColor = downvote ? '#ec8b88' : '#357ce6'; + const sliderColor = downvote ? '#ec8b88' : '#357ce6'; return ( @@ -249,20 +249,12 @@ class UpvoteView extends Component { isShow={!isVoting} /> - ) : isDownVoted ? ( - ) : ( )} @@ -342,7 +334,7 @@ class UpvoteView extends Component { {_amount} { const isDownVoted = (activeVotes, currentUserName) => { const result = activeVotes.find( - element => element.voter === currentUserName && element.percent < 0, + element => get(element, 'voter') === currentUserName && get(element, 'percent') < 0, ); if (result) { return result.percent;