diff --git a/src/App.js b/src/App.js index d888c49..38986ff 100644 --- a/src/App.js +++ b/src/App.js @@ -44,6 +44,8 @@ function UseVoteLocalStorage() { const vote = (id, up) => { const newVotes = [...storageVotes]; + console.log("new", newVotes); + const existingVoteIndex = newVotes.findIndex((vote) => vote.id === id); if (existingVoteIndex !== -1) { @@ -161,7 +163,7 @@ function App() { // remove votes for products which no longer in future products setVotes( votesRef.current.filter((v) => - data.FutureProducts.some((item) => item.id === v.id) + data.FutureProducts.some((item) => item.Id === v.id) ) ); })