fix: don't try to create a task with an empty title when creating multiple tasks at once

This commit is contained in:
kolaente 2021-09-29 21:01:54 +02:00
parent 96523f1fbf
commit 4bd2c94256
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 6 additions and 1 deletions

View File

@ -93,8 +93,13 @@ export default {
const newTasks = []
this.newTaskTitle.split(/[\r\n]+/).forEach(t => {
const title = cleanupTitle(t)
if (title === '') {
return
}
newTasks.push(
this.createNewTask(cleanupTitle(t), 0, this.$store.state.auth.settings.defaultListId, this.defaultPosition)
this.createNewTask(title, 0, this.$store.state.auth.settings.defaultListId, this.defaultPosition)
.then(task => {
this.$emit('taskAdded', task)
return task