diff --git a/src/components/tasks/mixins/attachmentUpload.js b/src/components/tasks/mixins/attachmentUpload.js index 798547aa..7d033081 100644 --- a/src/components/tasks/mixins/attachmentUpload.js +++ b/src/components/tasks/mixins/attachmentUpload.js @@ -17,7 +17,6 @@ export default { console.debug(`Uploaded attachments for task ${this.taskId}, response was`, r) if (r.success !== null) { r.success.forEach(a => { - this.$store.commit('attachments/removeById', a.id) this.$store.dispatch('tasks/addTaskAttachment', { taskId: this.taskId, attachment: a, diff --git a/src/store/modules/tasks.js b/src/store/modules/tasks.js index 546e82b4..2b6d5a25 100644 --- a/src/store/modules/tasks.js +++ b/src/store/modules/tasks.js @@ -41,6 +41,7 @@ export default { addTaskAttachment(ctx, {taskId, attachment}) { const t = ctx.rootGetters['kanban/getTaskById'](taskId) if (t.task === null) { + ctx.commit('attachments/add', attachment, {root: true}) return } t.task.attachments.push(attachment)