UNLV-CS472-672 / 2024-S-GROUP5-Munch

The Munch app is a social platform where users create profiles by selecting preferred foods.
1 stars 11 forks source link

Like Button Logic Errors #108

Closed razonm closed 3 months ago

razonm commented 3 months ago

Describe the bug The like button logic fails in some cases. When liking a post, logging off, then logging back in, the like count is correct, but pressing it causes another like API call to be sent instead of an unlike API call. This does not affect the backend since the API calls properly handle this case, but it is an inefficiency. When adding in a like animation, this will make the UI confusing for the user.

To Reproduce Steps to reproduce the behavior:

  1. Go to Feed or Friends
  2. Click on Like
  3. Sign out and sign back in
  4. Go back to the post you liked
  5. Press like again
  6. Look in the console log
  7. See that the wrong like API call was sent

Additional context (optional) This is probably because the initial state for the like button is set to False, but there are cases where a user will encounter a post that they have liked in the past.

This is related to PR #101

mitshelle commented 3 months ago

Closed with PR: https://github.com/UNLV-CS472-672/2024-S-GROUP5-Munch/pull/111