How to know when a Firestore document is written to local database #9308
Replies: 1 comment
-
When |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When the device is offline and I attempt to write a document to Firestore (e.g. with addDoc), the promise associated with the call to addDoc is pending until the document gets written to the remote Firestore (i.e. when the device comes back online). Often when writing data I want to show the user a loading screen, then direct the user to a different screen once the loading has completed. The problem I have is when I write a document using addDoc while the device is offline, I don't know when to direct the user to the "success" state since I have no idea when the document gets written to local storage. Is there some method for me to determine whether the write to local storage was successful?
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions