fix(task): cancel loading state when creating a new task does not work
This commit is contained in:
parent
f8450f58a4
commit
e999b38d3b
1 changed files with 11 additions and 6 deletions
|
@ -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()
|
||||||
const createdTask = await taskService.create(task)
|
try {
|
||||||
const result = await this.addLabelsToTask({
|
const createdTask = await taskService.create(task)
|
||||||
task: createdTask,
|
const result = await this.addLabelsToTask({
|
||||||
parsedLabels: parsedTask.labels,
|
task: createdTask,
|
||||||
})
|
parsedLabels: parsedTask.labels,
|
||||||
cancel()
|
})
|
||||||
|
} catch (e) {
|
||||||
|
throw e
|
||||||
|
} finally {
|
||||||
|
cancel()
|
||||||
|
}
|
||||||
return result
|
return result
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue