fix(task): cancel loading state when creating a new task does not work

This commit is contained in:
kolaente 2022-09-30 21:24:08 +02:00
parent f8450f58a4
commit e999b38d3b
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B

View file

@ -377,12 +377,17 @@ export const useTaskStore = defineStore('task', {
task.repeatAfter = parsedTask.repeats task.repeatAfter = parsedTask.repeats
const taskService = new TaskService() const taskService = new TaskService()
try {
const createdTask = await taskService.create(task) const createdTask = await taskService.create(task)
const result = await this.addLabelsToTask({ const result = await this.addLabelsToTask({
task: createdTask, task: createdTask,
parsedLabels: parsedTask.labels, parsedLabels: parsedTask.labels,
}) })
} catch (e) {
throw e
} finally {
cancel() cancel()
}
return result return result
}, },
}, },