Fix getting back to the kanban board after closing a task popup

This commit is contained in:
kolaente 2021-01-10 22:07:33 +01:00
parent 3e71b76c25
commit d7112c99c7
No known key found for this signature in database
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)
}
}, },
}, },
} }