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:
Go to Feed or Friends
Click on Like
Sign out and sign back in
Go back to the post you liked
Press like again
Look in the console log
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.
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:
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