#Page not updated immediately after removing specific movie

4 messages · Page 1 of 1 (latest)

low frigate
#

In your handler to remove the item you try this:

localStorage.setItem("watchlist", JSON.stringify(watchlist))
                .then(() => {
                    renderMovies()
                })

This is invalid since setItem() doesn't return anything so you're attempting to call renderMovies() on undefined.

Instead do this:

localStorage.setItem("watchlist", JSON.stringify(watchlist));
renderMovies();
sinful wagon
#

I have tried to do that, but the outcome still the same.

low frigate
#

Share your code

#

actually you need to pass the array of movies to render...

renderMovies(watchlist);