Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: "Toast message shows incorrect feedback when removing an upvote or downvote on a comment" #1322

Open
NawinKumarSharma opened this issue Sep 25, 2024 · 0 comments · May be fixed by #1323
Labels
bug Something isn't working

Comments

@NawinKumarSharma
Copy link

Describe the bug
When a comment is upvoted, the toast message correctly shows "Comment has been upvoted." However, when the user removes the upvote by clicking again, the same toast message ("Comment has been upvoted") is shown instead of indicating that the vote has been removed and similar for downvoting as well

To Reproduce
Steps to reproduce the behavior:

  1. Upvote a comment.
  2. Observe the toast message "Comment has been upvoted."
  3. Remove the upvote by clicking the upvote button again.
  4. The toast message again says "Comment has been upvoted" instead of indicating that the vote was removed.
    similarly,
  5. Downvote a comment.
  6. Observe the toast message "Comment has been downvoted."
  7. Remove the downvote by clicking the downvote button again.
  8. The toast message again says "Comment has been downvoted" instead of indicating that the vote was removed.
    Expected behavior
    When the user removes the upvote, the toast message should display "Vote has been removed" or something similar, instead of "Comment has been upvoted."

Screenshots or GIFs
If applicable, add screenshots or GIFs to help explain the problem.
Screencast from 2024-09-25 20-14-11.webm

Info (please complete the following information):

Browser: [e.g., Chrome, Safari]
Version: [e.g., 22]
Additional context
The issue seems to be related to the handleVote logic in the voting component, which does not differentiate between adding a vote and removing a vote.

@NawinKumarSharma NawinKumarSharma added the bug Something isn't working label Sep 25, 2024
@NawinKumarSharma NawinKumarSharma linked a pull request Sep 25, 2024 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant