1
0

fix(task): show correct success message when marking a repeating task as done

This commit is contained in:
kolaente 2024-06-17 15:41:18 +02:00
parent 47143af9d1
commit 06c3a64594
No known key found for this signature in database
GPG Key ID: F40E70337AB24C9B

View File

@ -111,7 +111,7 @@
<icon icon="align-left" />
</span>
<span
v-if="task.repeatAfter.amount > 0 || (task.repeatAfter.amount === 0 && task.repeatMode === TASK_REPEAT_MODES.REPEAT_MODE_MONTH)"
v-if="isRepeating"
class="project-task-icon"
>
<icon icon="history" />
@ -241,6 +241,8 @@ const taskService = shallowReactive(new TaskService())
const task = ref<ITask>(new TaskModel())
const showDefer = ref(false)
const isRepeating = computed(() => task.value.repeatAfter.amount > 0 || (task.value.repeatAfter.amount === 0 && task.value.repeatMode === TASK_REPEAT_MODES.REPEAT_MODE_MONTH))
watch(
() => theTask,
newVal => {
@ -303,11 +305,13 @@ async function markAsDone(checked: boolean) {
playPopSound()
}
emit('taskUpdated', newTask)
success({
message: task.value.done ?
t('task.doneSuccess') :
t('task.undoneSuccess'),
}, [{
let message = t('task.doneSuccess')
if (!task.value.done && !isRepeating.value) {
message = t('task.undoneSuccess')
}
success({message}, [{
title: t('task.undo'),
callback: () => undoDone(checked),
}])