fix: comment voting

This commit is contained in:
Kentai Radiquum 2024-08-09 13:35:24 +05:00
parent a4618124ea
commit e6271f20d9
Signed by: Radiquum
GPG key ID: 858E8EE696525EED
3 changed files with 2 additions and 6 deletions

View file

@ -64,14 +64,12 @@ export const CommentsComment = (props: {
setLikes(likes - 2);
_sendVote(1);
} else {
_sendVote(vote);
setVote(0);
_sendVote(0);
if (action === "dislike" && vote == 1) {
setLikes(likes + 1);
} else if (action === "like" && vote == 2) {
setLikes(likes - 1);
} else {
setLikes(props.comment.likes_count);
}
}
}