Skip to content

Commit

Permalink
fix(user): store user name first time
Browse files Browse the repository at this point in the history
user's name value wasn't stored the first time
  • Loading branch information
Francisco Moreno committed Oct 24, 2023
1 parent 2e56227 commit f59d219
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,9 @@ const App = () => {
.catch((error) => console.error('Something went wrong removing the bottle', error));
};

const saveUser = () => {
db.put({ _id: Uniqid('user-'), id: Uniqid(), name: user })
.then(() => setUser({ name: user }))
const saveUser = (name) => {
db.put({ _id: Uniqid('user-'), id: Uniqid(), name })
.then(() => setUser({ name }))
.catch((error) => console.error('Something went wrong saving your name', error));
};

Expand Down

0 comments on commit f59d219

Please sign in to comment.