fix: refresh tasks after completion
This commit is contained in:
@@ -499,7 +499,11 @@ async function patchTask(task: Task, patch: Partial<Task>) {
|
||||
async function toggle(task: Task) {
|
||||
try {
|
||||
await patchTask(task, { completed: !task.completed })
|
||||
if (activeView.value === 'today') void loadTodayTaskSummary()
|
||||
await loadTasksPage()
|
||||
if (activeView.value === 'today') {
|
||||
await loadOverdueTasks()
|
||||
void loadTodayTaskSummary()
|
||||
}
|
||||
toast(task.completed ? '已重新打开' : '完成啦')
|
||||
} catch (reason) { fail(reason) }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user