20.02 Read Data when user Logs In

This commit is contained in:
fwarren committed 2021-02-15 05:55:58 -08:00
1 parent f84098008b
commit e2dec4f1c6
2 files changed
+5 -1

No files matched your search

+2 -1
View File
@@ -37,13 +37,14 @@ const actions = {
logoutUser () {
firebaseAuth.signOut()
},
handleAuthStateChange ({ commit }) {
handleAuthStateChange ({ commit, dispatch }) {
firebaseAuth.onAuthStateChanged(user => {
Loading.hide()
if (user) {
commit('setLoggedIn', true)
/* eslint handle-callback-err: "off" */
this.$router.push('/').catch(err => {})
dispatch('tasks/fbReadData', null, { root: true })
} else {
commit('setLoggedIn', false)
this.$router.replace('/auth').catch(err => { })
+3
View File
@@ -66,6 +66,9 @@ const actions = {
},
setSort ({ commit }, value) {
commit('setSort', value)
},
fbReadData ({ commit }) {
console.log('read data from database')
}
}