Skip to content

Commit

Permalink
Merge branch 'main' into chore/thumbs-up-positions
Browse files Browse the repository at this point in the history
  • Loading branch information
nguernse authored Jun 26, 2024
2 parents fb7deee + cc9b565 commit 962f152
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/features/voting/ProposalLikeButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ export default function ProposalLikeButtons({
voteValue,
}: ProposalLikeButtonsProps) {
const handleLikeVote = (type: 'up' | 'down') => {
let currentVoteValue = voteValue ? voteValue : 0;
let currentVoteValue;
currentVoteValue = voteValue ?? 0;

if (type === 'up') currentVoteValue = Math.min(2, currentVoteValue + 1);
else currentVoteValue = Math.max(-2, currentVoteValue - 1);
Expand Down

0 comments on commit 962f152

Please sign in to comment.