fixed issue with upvote downvote local cache swap not updating ui

This commit is contained in:
Nouman Tahir 2021-07-09 21:31:55 +05:00
parent 5642819488
commit 06ea7e6bc4

View File

@ -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