File tree Expand file tree Collapse file tree
src/components/navigation Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -334,6 +334,7 @@ export default {
334334 .then (() => {
335335 this .loading = false
336336 this .deleted = true
337+ this .redirectToOverviewIfCurrentBoard ()
337338 this .undoTimeoutHandle = setTimeout (() => {
338339 this .$store .dispatch (' removeBoard' , this .board )
339340 }, 7000 )
@@ -359,6 +360,7 @@ export default {
359360 this .boardApi .leaveBoard (this .board )
360361 .then (() => {
361362 this .loading = false
363+ this .redirectToOverviewIfCurrentBoard ()
362364 this .$store .dispatch (' removeBoard' , this .board )
363365 })
364366 .catch (() => {
@@ -436,6 +438,12 @@ export default {
436438 }
437439 }
438440 },
441+ redirectToOverviewIfCurrentBoard () {
442+ const currentBoardId = Number .parseInt (this .$route ? .params ? .id , 10 )
443+ if (! Number .isNaN (currentBoardId) && currentBoardId === this .board .id ) {
444+ this .$router .push ({ name: ' main' })
445+ }
446+ },
439447 },
440448}
441449< / script>
You can’t perform that action at this time.
0 commit comments