[Vuejs]-Firebase function reload for auth currentUser, doesn't refresh in vue component

0👍

One alternative would be to have a simple property in the data object and update it in your function, as follows:

data: {
  //....
  photoUrl: null,
  //....
}

//...
onFileChanged: async function(e) {
      this.image = e.target.files[0];
      if (this.image) {
        try {
          this.loading = true;
          const url = await saveImage(this.image, this.uploadProgress);
          this.photoUrl = url;  // <-------
          await auth.currentUser.updateProfile({
            photoURL: url
          });
          await auth.currentUser.reload();
        } catch (error) {
          //...
        } finally {
          //...
        }
      }
    }

Leave a comment