Skip to content

Commit

Permalink
resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
andrzejewsky committed Jul 23, 2019
1 parent 59269a3 commit 80d545a
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions core/modules/user/store/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ const actions: ActionTree<UserState, RootState> = {
commit(types.USER_TOKEN_CHANGED, { newToken })
dispatch('sessionAfterAuthorized', {})

if (config.usePriceTiers) {
const userData = await usersCollection.getItem('current-user')

if (userData) {
dispatch('setUserGroup', userData)
}
const userData = await usersCollection.getItem('current-user')

if (userData) {
dispatch('setUserGroup', userData)
}

} else {
EventBus.$emit('session-after-nonauthorized')
}
Expand Down Expand Up @@ -94,17 +94,12 @@ const actions: ActionTree<UserState, RootState> = {
* @param userData
*/
setUserGroup ({ commit }, userData) {
if (config.usePriceTiers) {
if (userData.groupToken) {
commit(types.USER_GROUP_TOKEN_CHANGED, userData.groupToken)
}
if (userData.groupToken) {
commit(types.USER_GROUP_TOKEN_CHANGED, userData.groupToken)
}

if (userData.group_id) {
commit(types.USER_GROUP_CHANGED, userData.group_id)
}
} else {
commit(types.USER_GROUP_TOKEN_CHANGED, '')
commit(types.USER_GROUP_CHANGED, null)
if (userData.group_id) {
commit(types.USER_GROUP_CHANGED, userData.group_id)
}
},
async restoreCurrentUserFromCache ({ commit, dispatch }) {
Expand Down

0 comments on commit 80d545a

Please sign in to comment.