From cb3f26993701e9fa8884eacbde7a72755784da13 Mon Sep 17 00:00:00 2001 From: kolaente Date: Thu, 21 Jul 2022 15:57:03 +0200 Subject: [PATCH] fix(kanban): reset loading state after creating a task Resolves: https://kolaente.dev/vikunja/frontend/issues/2184 --- src/store/modules/tasks.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/store/modules/tasks.ts b/src/store/modules/tasks.ts index 026f0167..a0b7671b 100644 --- a/src/store/modules/tasks.ts +++ b/src/store/modules/tasks.ts @@ -291,7 +291,7 @@ export default { listId, position, }) { - setLoading({commit}, 'tasks') + const cancel = setLoading({commit}, 'tasks') const parsedTask = parseTaskText(title, getQuickAddMagicMode()) const foundListId = await dispatch('findListId', { @@ -321,10 +321,12 @@ export default { const taskService = new TaskService() const createdTask = await taskService.create(task) - return dispatch('addLabelsToTask', { + const result = await dispatch('addLabelsToTask', { task: createdTask, parsedLabels: parsedTask.labels, }) + cancel() + return result }, }, } \ No newline at end of file