fix: include overdue tasks in today summary
This commit is contained in:
@@ -377,10 +377,17 @@ async function loadTodayTaskSummary() {
|
||||
const data = await api(`/tasks?${params}`)
|
||||
return Number(data.total ?? data.items?.length ?? 0)
|
||||
}
|
||||
const [open, completed] = await Promise.all([summaryTotal(false), summaryTotal(true)])
|
||||
const overdueTotal = async () => {
|
||||
const params = new URLSearchParams({ page: '1', page_size: '1' })
|
||||
params.set('due_to', isoAtLocalDayOffset(0))
|
||||
params.set('completed', 'false')
|
||||
const data = await api(`/tasks?${params}`)
|
||||
return Number(data.total ?? data.items?.length ?? 0)
|
||||
}
|
||||
const [open, completed, overdue] = await Promise.all([summaryTotal(false), summaryTotal(true), overdueTotal()])
|
||||
if (token !== todaySummaryLoadToken || activeView.value !== 'today') return
|
||||
todayTaskCompleted.value = completed
|
||||
todayTaskTotal.value = open + completed
|
||||
todayTaskTotal.value = overdue + open + completed
|
||||
} catch { /* 概览统计失败不阻断今天页 */ }
|
||||
}
|
||||
async function loadOverdueTasks() {
|
||||
|
||||
Reference in New Issue
Block a user