ryanmio / DecodeMe-

DecodeMe! is a coding game with integrated language model.
https://decodeme.app/
MIT License
2 stars 0 forks source link

Auth bugs #59

Closed ryanmio closed 8 months ago

ryanmio commented 8 months ago

This addresses the issue where the leaderboardName was null when a user signed in. The root cause was that the handleUserUpdate function, which fetches the leaderboardName from Firestore, was not being called when the user state updated.

The following changes were made to fix this issue:

  1. Added a useEffect hook in index.js to call handleUserUpdate whenever the user state updates. This ensures that the leaderboardName is fetched from Firestore and set in the state whenever a user signs in.

  2. Added console logs in handleUserUpdate to log the leaderboardName after it's fetched from Firestore and set in the state. This helps with debugging and verifying that the leaderboardName is being correctly fetched and set.

With these changes, the leaderboardName is no longer null when a user signs in, and it is correctly passed as a prop to GameOver.js.

netlify[bot] commented 8 months ago

Deploy Preview for decode-me ready!

Name Link
Latest commit 04907c19f6483c56b7b1772187650e984df3f4df
Latest deploy log https://app.netlify.com/sites/decode-me/deploys/65a34ad82ddaa30008dc2119
Deploy Preview https://deploy-preview-59--decode-me.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.