JoarHansson/space-images-app

Change faulty state logic

Open

#4 opened on Sep 3, 2024

 (1 comment) (0 reactions) (0 assignees)JavaScript (2 forks)auto 404
buggood first issuehacktoberfesthelp wanted

Repository metrics

Stars
 (2 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

  • Faulty logic: setImgLiked(false); in Home.jsx:26 and Home.jsx:68.

    • The logic is faulty because if it assumes the image thats going to show up is not going to be "liked" already, which can indeed be the case.
    • Local storage is already used to save (Home.jsx) and view images (Likes.jsx), and could probably be used here too.
    • A good way to recreate the problem/test a solution is to choose an image by date in the DateInput, like it, choose another image, and then choose it again to see if it's liked.

Contributor guide