diff --git a/src/store/modules/tasks.ts b/src/store/modules/tasks.ts index 209cdb952a..1fc4998447 100644 --- a/src/store/modules/tasks.ts +++ b/src/store/modules/tasks.ts @@ -5,7 +5,7 @@ import TaskAssigneeService from '@/services/taskAssignee' import TaskAssigneeModel from '../../models/taskAssignee' import LabelTaskModel from '../../models/labelTask' import LabelTaskService from '@/services/labelTask' -import {HAS_TASKS} from '../mutation-types' +import {HAS_TASKS, LOADING_MODULE} from '../mutation-types' import {setLoading} from '../helper' import {getQuickAddMagicMode} from '@/helpers/quickAddMagicMode' @@ -286,12 +286,13 @@ export default { return foundListId }, - async createNewTask({dispatch}, { + async createNewTask({dispatch, commit}, { title, bucketId, listId, position, }) { + setLoading({commit}, 'tasks') const parsedTask = parseTaskText(title, getQuickAddMagicMode()) const foundListId = await dispatch('findListId', { diff --git a/src/views/list/ListKanban.vue b/src/views/list/ListKanban.vue index 33010dd629..ccaddd9a4f 100644 --- a/src/views/list/ListKanban.vue +++ b/src/views/list/ListKanban.vue @@ -140,10 +140,10 @@ @@ -424,6 +424,7 @@ export default defineComponent({ const task = newBucket.tasks[newTaskIndex] const taskBefore = newBucket.tasks[newTaskIndex - 1] ?? null const taskAfter = newBucket.tasks[newTaskIndex + 1] ?? null + this.taskUpdating[task.id] = true const newTask = cloneDeep(task) // cloning the task to avoid vuex store mutations newTask.bucketId = newBucket.id @@ -463,7 +464,7 @@ export default defineComponent({ return } this.newTaskError[bucketId] = false - + const task = await this.$store.dispatch('tasks/createNewTask', { title: this.newTaskText, bucketId,