v0.3.0 修正:重复任务无日期自动补当天、通知高度自适应

This commit is contained in:
XIGE
2026-11-28 01:14:09 +08:00
parent 3e237fafdb
commit 9bce4c77c2
4 changed files with 27 additions and 5 deletions

View File

@@ -211,8 +211,10 @@ class TaskSheet(
}
val note = etNote.text.toString().trim()
val every = if (repeatType == Repeat.NONE) 1 else repeatEvery.coerceAtLeast(1)
// 重复任务必须有日期作为节奏起点,否则既进不了「今日」,也无法按间隔滚动
val effectiveDue = if (repeatType != Repeat.NONE && due <= 0) Dates.todayStart() else due
if (existing == null) {
Store.addTask(title, note, projectId, priority, focusMin, due, repeatType, every)
Store.addTask(title, note, projectId, priority, focusMin, effectiveDue, repeatType, every)
} else {
Store.updateTask(
existing.copy(
@@ -221,7 +223,7 @@ class TaskSheet(
projectId = projectId,
priority = priority,
focusMinutes = focusMin,
due = due,
due = effectiveDue,
repeatType = repeatType,
repeatEvery = every,
)