diff --git a/frontend/src/components/TeamSelection.vue b/frontend/src/components/TeamSelection.vue index bf8483f7bc..5e907e1c9c 100644 --- a/frontend/src/components/TeamSelection.vue +++ b/frontend/src/components/TeamSelection.vue @@ -51,14 +51,12 @@ export default { methods: { selectTeam (team) { if (team) { - this.$store.dispatch('account/setTeam', team.slug) - .then(() => this.$router.push({ - name: 'Team', - params: { - team_slug: team.slug - } - })) - .catch(e => console.warn(e)) + this.$router.push({ + name: 'Team', + params: { + team_slug: team.slug + } + }) } }, createTeam () { diff --git a/frontend/src/pages/account/Teams/Invitations.vue b/frontend/src/pages/account/Teams/Invitations.vue index 1b371183f4..1b2dfb2722 100644 --- a/frontend/src/pages/account/Teams/Invitations.vue +++ b/frontend/src/pages/account/Teams/Invitations.vue @@ -53,14 +53,12 @@ export default { await this.$store.dispatch('account/refreshTeams') Alerts.emit(`Invite to "${invite.team.name}" has been accepted.`, 'confirmation') // navigate to team dashboad once invite accepted - this.$store.dispatch('account/setTeam', invite.team.slug) - .then(() => this.$router.push({ - name: 'Team', - params: { - team_slug: invite.team.slug - } - })) - .catch(e => console.warn(e)) + this.$router.push({ + name: 'Team', + params: { + team_slug: invite.team.slug + } + }) }, async rejectInvite (invite) { await userApi.rejectTeamInvitation(invite.id, invite.team.id) diff --git a/frontend/src/pages/admin/Teams.vue b/frontend/src/pages/admin/Teams.vue index cf9438a682..6c42901687 100644 --- a/frontend/src/pages/admin/Teams.vue +++ b/frontend/src/pages/admin/Teams.vue @@ -221,14 +221,12 @@ export default { this.loading = false }, viewTeam (row) { - this.$store.dispatch('account/setTeam', row.slug) - .then(() => this.$router.push({ - name: 'Team', - params: { - team_slug: row.slug - } - })) - .catch(e => console.warn(e)) + this.$router.push({ + name: 'Team', + params: { + team_slug: row.slug + } + }) } } } diff --git a/frontend/src/pages/team/index.vue b/frontend/src/pages/team/index.vue index d9d9720fca..2be9a23625 100644 --- a/frontend/src/pages/team/index.vue +++ b/frontend/src/pages/team/index.vue @@ -66,6 +66,11 @@ export default { return this.isAdminUser || this.teamMembership?.role >= Roles.Viewer } }, + watch: { + '$route.params.team_slug' (slug) { + this.$store.dispatch('account/setTeam', slug) + } + }, mounted () { this.mounted = true },