removed upvote status calculator for testing

This commit is contained in:
Nouman Tahir 2021-03-18 00:03:28 +05:00
parent 41da5dfa95
commit 84d01b2170

View File

@ -46,21 +46,21 @@ const UpvoteContainer = (props) => {
useEffect(() => {
let _isMounted = true;
const _calculateVoteStatus = async () => {
const _isVoted = await isVotedFunc(activeVotes, get(currentAccount, 'name'));
const _isDownVoted = await isDownVotedFunc(activeVotes, get(currentAccount, 'name'));
// const _calculateVoteStatus = async () => {
// const _isVoted = await isVotedFunc(activeVotes, get(currentAccount, 'name'));
// const _isDownVoted = await isDownVotedFunc(activeVotes, get(currentAccount, 'name'));
if (_isMounted) {
setIsVoted(_isVoted && parseInt(_isVoted, 10) / 10000);
setIsDownVoted(_isDownVoted && (parseInt(_isDownVoted, 10) / 10000) * -1);
// if (_isMounted) {
// setIsVoted(_isVoted && parseInt(_isVoted, 10) / 10000);
// setIsDownVoted(_isDownVoted && (parseInt(_isDownVoted, 10) / 10000) * -1);
if (localVoteMap) {
_handleLocalVote();
}
}
};
// if (localVoteMap) {
// _handleLocalVote();
// }
// }
// };
_calculateVoteStatus();
// _calculateVoteStatus();
return () => (_isMounted = false);
}, [activeVotes]);