Actually use the list when creating a new task

This commit is contained in:
kolaente 2021-07-17 21:22:43 +02:00
parent 7b8fbe1835
commit 0e02b38c1e
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 5 additions and 8 deletions

View File

@ -1,5 +1,5 @@
<template>
<div>
<div v-if="listIdToUse !== null">
<div class="field is-grouped">
<p :class="{ 'is-loading': taskService.loading}" class="control has-icons-left is-expanded">
<input
@ -83,8 +83,7 @@ export default {
taskService: TaskService,
labelService: LabelService,
labelTaskService: LabelTaskService,
listIdForNewTask: null,
validListIdAvailable: false,
listIdToUse: null,
showError: false,
}
},
@ -110,11 +109,9 @@ export default {
// If the parent provides the ID alway use that be falling back to the one
// stored in settings. If neither are avliable then hide the component.
if (this.listId !== undefined) {
this.listIdForNewTask = this.listId
this.validListIdAvailable = true
this.listIdToUse = this.listId
} else if (this.$store.state.auth.settings.defaultListId !== undefined) {
this.listIdForNewTask = this.$store.state.auth.settings.defaultListId
this.validListIdAvailable = true
this.listIdToUse = this.$store.state.auth.settings.defaultListId
}
},
methods: {
@ -125,7 +122,7 @@ export default {
}
this.showError = false
this.createNewTask(this.newTaskText)
this.createNewTask(this.newTaskText, 0, this.listIdToUse)
.then(task => {
this.newTaskText = ''
this.$emit('taskAdded', task)