fix: undo task done from list view

This commit is contained in:
kolaente 2022-02-26 13:18:44 +01:00
parent 7b62a0895d
commit 051dd98ff7
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B
2 changed files with 7 additions and 4 deletions

View file

@ -190,10 +190,7 @@ export default {
this.$t('task.undoneSuccess'), this.$t('task.undoneSuccess'),
}, [{ }, [{
title: 'Undo', title: 'Undo',
callback() { callback: () => this.undoDone(checked),
this.task.done = !this.task.done
this.markAsDone(!checked)
},
}]) }])
} }
@ -204,6 +201,11 @@ export default {
} }
}, },
undoDone(checked) {
this.task.done = !this.task.done
this.markAsDone(!checked)
},
async toggleFavorite() { async toggleFavorite() {
this.task.isFavorite = !this.task.isFavorite this.task.isFavorite = !this.task.isFavorite
this.task = await this.taskService.update(this.task) this.task = await this.taskService.update(this.task)

View file

@ -299,6 +299,7 @@ export default defineComponent({
break break
} }
} }
// FIXME: Use computed
sortTasks(this.tasks) sortTasks(this.tasks)
}, },