18.13 Show a Loading Overlay when Logging In

This commit is contained in:
Fredrick W. Warren 2021-02-14 21:51:51 -08:00
parent e12277da94
commit f84098008b
2 changed files with 6 additions and 2 deletions

View File

@ -1,6 +1,7 @@
import { Dialog } from 'quasar'
import { Dialog, Loading } from 'quasar'
export function showErrorMessage (errorMessage) {
Loading.hide()
Dialog.create({
title: 'Error',
message: errorMessage

View File

@ -1,4 +1,4 @@
import { LocalStorage } from 'quasar'
import { LocalStorage, Loading } from 'quasar'
import { firebaseAuth } from 'boot/firebase'
import { showErrorMessage } from 'src/functions/function-show-error-message'
@ -15,6 +15,7 @@ const mutations = {
const actions = {
registerUser ({ commit }, payload) {
Loading.show()
firebaseAuth.createUserWithEmailAndPassword(payload.email, payload.password)
.then(response => {
console.log('response: ', response)
@ -24,6 +25,7 @@ const actions = {
})
},
loginUser ({ commit }, payload) {
Loading.show()
firebaseAuth.signInWithEmailAndPassword(payload.email, payload.password)
.then(response => {
console.log('response: ', response)
@ -37,6 +39,7 @@ const actions = {
},
handleAuthStateChange ({ commit }) {
firebaseAuth.onAuthStateChanged(user => {
Loading.hide()
if (user) {
commit('setLoggedIn', true)
/* eslint handle-callback-err: "off" */