diff --git a/website/client/src/components/tasks/column.vue b/website/client/src/components/tasks/column.vue index ea06d9072c..a39b738d0f 100644 --- a/website/client/src/components/tasks/column.vue +++ b/website/client/src/components/tasks/column.vue @@ -83,7 +83,7 @@ taskId === taskIdToReplace); + const taskIdToReplace = filteredList[data.newIndex]._id; + const newIndexOnServer = originTasks.findIndex(task => task._id === taskIdToReplace); let newOrder; if (taskToMove.group.id && !this.isUser) { @@ -568,6 +569,9 @@ export default { // Client const deleted = originTasks.splice(data.oldIndex, 1); originTasks.splice(data.newIndex, 0, deleted[0]); + this.rerendering = true; + await this.$nextTick(); + this.rerendering = false; }, async moveTo (task, where) { // where is 'top' or 'bottom' const taskIdToMove = task._id; diff --git a/website/client/src/pages/user-main.vue b/website/client/src/pages/user-main.vue index 18736e0202..cbe6dbd24c 100644 --- a/website/client/src/pages/user-main.vue +++ b/website/client/src/pages/user-main.vue @@ -4,6 +4,7 @@ :class="{ 'casting-spell': castingSpell, }" + @dragover.prevent > diff --git a/website/client/src/store/actions/tasks.js b/website/client/src/store/actions/tasks.js index d2e077ec33..22958492c1 100644 --- a/website/client/src/store/actions/tasks.js +++ b/website/client/src/store/actions/tasks.js @@ -158,11 +158,15 @@ export async function collapseChecklist (store, task) { } export async function destroy (store, task) { - const list = store.state.tasks.data[`${task.type}s`]; - const taskIndex = list.findIndex(t => t._id === task._id); + const type = `${task.type}s`; + const listIndex = store.state.tasks.data[type].findIndex(t => t._id === task._id); + const orderIndex = store.state.user.data.tasksOrder[type].indexOf(task._id); - if (taskIndex > -1) { - list.splice(taskIndex, 1); + if (listIndex > -1) { + store.state.tasks.data[type].splice(listIndex, 1); + } + if (orderIndex > -1) { + store.state.user.data.tasksOrder[type].splice(orderIndex, 1); } await axios.delete(`/api/v4/tasks/${task._id}`);