Skip to content

Commit

Permalink
Leaderboard update
Browse files Browse the repository at this point in the history
  • Loading branch information
mohanamisra committed Jun 27, 2024
1 parent 88a77fc commit fc51d3c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pages/GameOver.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ const GameOver = () => {
const docSnap = await getDoc(docRef);
if(docSnap.exists()) {
if(location.state.score > docSnap.data().highscore) {
console.log(user.uid);
await updateDoc(docRef, {
...docSnap.data(),
highscore: location.state.score
})
});
await fetchLeaderboardData();
}
setPlayer(
location.state.score > docSnap.data().highscore?
Expand Down

0 comments on commit fc51d3c

Please sign in to comment.