Fix getting back to the kanban board after closing a task popup
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
kolaente 2021-01-10 22:07:33 +01:00
parent 3e71b76c25
commit d7112c99c7
Signed by: konrad
GPG Key ID: F40E70337AB24C9B

View File

@ -13,16 +13,29 @@
<script> <script>
import TaskDetailView from './TaskDetailView' import TaskDetailView from './TaskDetailView'
import router from '../../router'
export default { export default {
name: 'TaskDetailViewModal', name: 'TaskDetailViewModal',
components: { components: {
TaskDetailView, TaskDetailView,
}, },
data() {
return {
lastRoute: null,
}
},
beforeRouteEnter(to, from, next) {
next(vm => {
vm.lastRoute = from
})
},
methods: { methods: {
close() { close() {
router.back() if (this.lastRoute === null) {
this.$router.back()
} else {
this.$router.push(this.lastRoute)
}
}, },
}, },
} }