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;