fix: don't try to load a task view with the id of the list

This commit is contained in:
kolaente 2021-12-26 19:05:06 +01:00
parent 7e8e26679c
commit 75c82d010b
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 7 additions and 0 deletions

View File

@ -524,6 +524,13 @@ export default {
},
computed: {
taskId() {
// This ensures we're actually dealing with a task route and not trying to load a task with the id of
// its list. When closing the modal, this watcher gets triggered because the route param of the list
// route is also called "id".
if (!this.$route.name.startsWith('task')) {
return undefined
}
const {id} = this.$route.params
return id === undefined ? id : Number(id)
},