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(); incrementVoteCount();
} }
if (isDownvote) { setIsDownVoted(isDownvote ? true : false);
setIsDownVoted(true); setIsVoted(isDownvote ? false : true);
} else {
setIsVoted(true);
}
} }
}; };
@ -105,11 +102,8 @@ const UpvoteContainer = (props) => {
incrementVoteCount(); incrementVoteCount();
} }
if (isDownvote) { setIsDownVoted(isDownvote ? true : false);
setIsDownVoted(true); setIsVoted(isDownvote ? false : true);
} else {
setIsVoted(true);
}
setTotalPayout(totalPayout + amountNum); setTotalPayout(totalPayout + amountNum);
//update redux //update redux