fixed default vote value issue

This commit is contained in:
Nouman Tahir 2021-07-17 23:05:38 +05:00
parent daf479174f
commit 7a4cce9166

View File

@ -87,13 +87,14 @@ const UpvoteView = ({
useEffect(() => {
setSliderValue(
(isVoted || isDownVoted)
? 1
: upvotePercent <= 1
? upvotePercent
: 1
)
const value = (isVoted || isDownVoted)
? 1
: upvotePercent <= 1
? upvotePercent
: 1;
setSliderValue(value);
_calculateEstimatedAmount(value);
}, [upvotePercent])