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