JoarHansson/space-images-app

Change faulty state logic

Ouverte

#4 ouverte le 3 sept. 2024

 (1 commentaire) (0 réaction) (0 personne assignée)JavaScript (2 forks)auto 404
buggood first issuehacktoberfesthelp wanted

Métriques du dépôt

Stars
 (2 étoiles)
Métriques de merge PR
 (Métriques PR en attente)

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.

Guide contributeur