Reputation: 647
I'm having a little problem or you doubt Cloud Firestore in JavaScript. The problem is this: I have a web application that will use or not, the offline persistence of Firestore that will be called by enablePersistence () until then ok, but I would like to know if there is any way I can find out if this persistence is already enabled when my user comes back after a while, and if so how can I disable this persistence?
Upvotes: 1
Views: 500
Reputation: 598728
There is no public API to determine whether persistence is currently enabled. If you need to know whether it is, you'll have to store that somewhere yourself. For example, you could write the value into localStorage
when you enable/disable it, and read it from there.
Upvotes: 1