From 30067935d14a56fc54ab398365ba5d083a9c1d4d Mon Sep 17 00:00:00 2001 From: kolaente Date: Thu, 15 Apr 2021 17:17:45 +0200 Subject: [PATCH] Fix undo when marking a task as done --- src/components/tasks/partials/singleTaskInList.vue | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/components/tasks/partials/singleTaskInList.vue b/src/components/tasks/partials/singleTaskInList.vue index a0b987f3c..7031e7c14 100644 --- a/src/components/tasks/partials/singleTaskInList.vue +++ b/src/components/tasks/partials/singleTaskInList.vue @@ -170,7 +170,7 @@ export default { const updateFunc = () => { this.taskService.update(this.task) .then(t => { - if(this.task.done) { + if (this.task.done) { playPop() } this.task = t @@ -180,11 +180,10 @@ export default { this, [{ title: 'Undo', - callback: () => this.markAsDone({ - target: { - checked: !checked, - }, - }), + callback: () => { + this.task.done = !this.task.done + this.markAsDone(!checked) + } }], ) })