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

Fixes saved state of brewery card not persisting between nav changes #1

Merged
merged 1 commit into from
Jul 1, 2022
Merged

Fixes saved state of brewery card not persisting between nav changes #1

merged 1 commit into from
Jul 1, 2022

Conversation

mklilley
Copy link
Contributor

@mklilley mklilley commented Jul 1, 2022

Currently, BreweryCard component does not persist the saved state of a brewery when you navigate away from the Breweries page and back again. Because of this, a user can select to add the same brewery more than once which causes duplicates on the Saved page.

This bug is occurring because include is being used to check whether an object exists inside an array of objects. It turns out you can't do this for reasons explained in this StackOverflow article. The recommendation is to use some instead. I've updated the code accordingly.

@Peritract Peritract merged commit 0ff1f3a into Peritract:main Jul 1, 2022
@Peritract
Copy link
Owner

@mklilley You're the best; thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants