firebase-module icon indicating copy to clipboard operation
firebase-module copied to clipboard

What is the best way for clear persistence data ?

Open tibs245 opened this issue 3 years ago • 1 comments

Hi,

I want clear all firestore data (persisted) on disconnection :

this.$fireModule
  .firestore()
  .clearPersistence()
  .catch((error) => {
    console.error(
      'Thank you to delete app data manually",
      error.code
    )
  })

But I have error because app is initialized: FirebaseError: Persistence can only be cleared before a Firestore instance is initialized or after it is terminated.

What is the best way for clear all firestore data ?

tibs245 avatar May 03 '21 15:05 tibs245

Hey @tibs245

Currently this will be hard to do, but we could probably implement this as an option similarly to how we do it for enablePersistence: https://firebase.nuxtjs.org/service-options/firestore#enablepersistence

Won't have time the next few weeks, feel free to create a PR for it if you need the feature :)

br, Pascal

lupas avatar Jun 11 '21 22:06 lupas