diff --git a/src/components/navigation/AppNavigationBoard.vue b/src/components/navigation/AppNavigationBoard.vue index eda417bb6f..f31365f909 100644 --- a/src/components/navigation/AppNavigationBoard.vue +++ b/src/components/navigation/AppNavigationBoard.vue @@ -334,6 +334,7 @@ export default { .then(() => { this.loading = false this.deleted = true + this.redirectToOverviewIfCurrentBoard() this.undoTimeoutHandle = setTimeout(() => { this.$store.dispatch('removeBoard', this.board) }, 7000) @@ -359,6 +360,7 @@ export default { this.boardApi.leaveBoard(this.board) .then(() => { this.loading = false + this.redirectToOverviewIfCurrentBoard() this.$store.dispatch('removeBoard', this.board) }) .catch(() => { @@ -436,6 +438,12 @@ export default { } } }, + redirectToOverviewIfCurrentBoard() { + const currentBoardId = Number.parseInt(this.$route?.params?.id, 10) + if (!Number.isNaN(currentBoardId) && currentBoardId === this.board.id) { + this.$router.push({ name: 'main' }) + } + }, }, }