fix(task): show correct success message when marking a repeating task as done
This commit is contained in:
parent
47143af9d1
commit
06c3a64594
@ -111,7 +111,7 @@
|
|||||||
<icon icon="align-left" />
|
<icon icon="align-left" />
|
||||||
</span>
|
</span>
|
||||||
<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"
|
class="project-task-icon"
|
||||||
>
|
>
|
||||||
<icon icon="history" />
|
<icon icon="history" />
|
||||||
@ -132,7 +132,7 @@
|
|||||||
:color="projectColor"
|
:color="projectColor"
|
||||||
class="mr-1"
|
class="mr-1"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<router-link
|
<router-link
|
||||||
v-if="showProjectSeparately"
|
v-if="showProjectSeparately"
|
||||||
v-tooltip="$t('task.detail.belongsToProject', {project: project.title})"
|
v-tooltip="$t('task.detail.belongsToProject', {project: project.title})"
|
||||||
@ -241,6 +241,8 @@ const taskService = shallowReactive(new TaskService())
|
|||||||
const task = ref<ITask>(new TaskModel())
|
const task = ref<ITask>(new TaskModel())
|
||||||
const showDefer = ref(false)
|
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(
|
watch(
|
||||||
() => theTask,
|
() => theTask,
|
||||||
newVal => {
|
newVal => {
|
||||||
@ -303,11 +305,13 @@ async function markAsDone(checked: boolean) {
|
|||||||
playPopSound()
|
playPopSound()
|
||||||
}
|
}
|
||||||
emit('taskUpdated', newTask)
|
emit('taskUpdated', newTask)
|
||||||
success({
|
|
||||||
message: task.value.done ?
|
let message = t('task.doneSuccess')
|
||||||
t('task.doneSuccess') :
|
if (!task.value.done && !isRepeating.value) {
|
||||||
t('task.undoneSuccess'),
|
message = t('task.undoneSuccess')
|
||||||
}, [{
|
}
|
||||||
|
|
||||||
|
success({message}, [{
|
||||||
title: t('task.undo'),
|
title: t('task.undo'),
|
||||||
callback: () => undoDone(checked),
|
callback: () => undoDone(checked),
|
||||||
}])
|
}])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user