abhisheknaiidu / class-karona

https://class-karona.vercel.app
8 stars 7 forks source link

fix first time login bug #23

Open zephy20 opened 3 years ago

zephy20 commented 3 years ago

Fixed the bug where the UI didn't change when a user logs in for the first time.

Issue: When a user logs in for the first time, then we first adds his data/document(setting data on firestore) on the firestore collection. But since this is async, and by the time we try to access that new document in App.js, it's not added yet.

So I tried to fix this with the help of async/await. Basically, I added a helper function to add a new user document to the collection in App.js and call it if the data from snapshot isn't available yet.

Let me know if you find any issues in it!

vercel[bot] commented 3 years ago

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/abhisheknaiidu/class-karona/oi18cngip
✅ Preview: https://class-karona-git-fork-zephy20-firestore-bug-fix.abhisheknaiidu.vercel.app