Skip to content

Commit

Permalink
new Timestamp update
Browse files Browse the repository at this point in the history
  • Loading branch information
s-dimaria committed May 28, 2023
1 parent 49a4bbf commit ae60d2f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/components/modals/HowToPlay.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ function HowToPlay() {
const infoUser = {
name: username,
score: 0,
timestamp: new Date().getTime()
};

await setUser(username, infoUser);
Expand Down
6 changes: 3 additions & 3 deletions src/components/utils/firebaseRealtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ function getDB() {
return db;
}

async function setUser(user: string, score: any) {
async function setUser(username: string, user: any) {

var u = uid(16);
localStorage.setItem("uid", u);
localStorage.setItem("user", user);
localStorage.setItem("user", username);

await set(ref(db, "users/" + u), score);
await set(ref(db, "users/" + u), user);

return u;
}
Expand Down

0 comments on commit ae60d2f

Please sign in to comment.