-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved logout to store, login still an issue
- Loading branch information
Showing
9 changed files
with
55 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ import { fireb } from '../plugins/firebase' | |
Vue.use(Vuex) | ||
|
||
const initialState = { | ||
user: {}, // {displayName: 'Joel', email: '[email protected]'}, | ||
user: null, // {displayName: 'Joel', email: '[email protected]'}, | ||
lastPOI: {}, // {lat: 40.34923, lng: -74.65955}, | ||
profile: {}, | ||
simplePoints: 10, | ||
|
@@ -20,8 +20,8 @@ const initialState = { | |
//const state = Object.assign({}, initialState) | ||
|
||
const state = { | ||
user: {}, | ||
lastPOI: {}, | ||
user: {displayName: 'Joel', email: '[email protected]'}, | ||
lastPOI: {}, // {lat: 40.34923, lng: -74.65955}, | ||
profile: {}, | ||
simplePoints: 10, | ||
tagPoints: 50, | ||
|
@@ -33,6 +33,7 @@ const mutations = { | |
SET_USER (state, user) { | ||
state.user = user | ||
console.log("Mutation User: " + user.displayName) | ||
console.log("New user state: " + state.user.displayName) | ||
}, | ||
SET_PROFILE (state, profile) { | ||
state.profile = profile | ||
|
@@ -51,9 +52,9 @@ const mutations = { | |
} | ||
|
||
const actions = { | ||
setUser (context, user) { | ||
setUser ({commit}, user) { | ||
console.log("SetUser Action :" + user.displayName) | ||
context.commit('SET_USER', user) | ||
commit('SET_USER', user) | ||
if (user) { | ||
fireb.database().ref('user_profiles').orderByChild('user_email') | ||
.equalTo(user.email) | ||
|
@@ -71,19 +72,24 @@ const actions = { | |
}) | ||
} | ||
}, | ||
setProfile (context, profile) { | ||
context.commit('SET_PROFILE', profile) | ||
setProfile ({commit}, profile) { | ||
commit('SET_PROFILE', profile) | ||
}, | ||
setTaglist (context, userTags) { | ||
context.commit('SET_TAGLIST', userTags) | ||
setTaglist ({commit}, userTags) { | ||
commit('SET_TAGLIST', userTags) | ||
}, | ||
// Point of Interest | ||
setLastPOI (context, poi) { | ||
context.commit('SET_POI', poi) | ||
setLastPOI ({commit}, poi) { | ||
commit('SET_POI', poi) | ||
}, | ||
resetState ({commit}) { | ||
commit('RESET_STATE') //, state) | ||
}, | ||
logout ({commit}) { | ||
fireb.auth().signOut() | ||
commit('SET_USER', null) | ||
commit('RESET_STATE') | ||
}, | ||
resetState (context) { | ||
context.commit('RESET_STATE', state) | ||
} | ||
} | ||
|
||
const getters = { | ||
|