0👍
Make getUserGroups async so that way await this.$store.dispatch(‘getUserGroups’) awaits results:
async getUserGroups({ commit }) {
const resp = await GroupsService.getGroups()
console.log('in store getUserGroups, this is usergroups: ', resp);
console.log('setting currentGroup as resp[0]: ', resp[0]) //this is correct
commit('setCurrentGroup', resp[0]);
}
Source:stackexchange.com