v0.3.0 修正:重复任务无日期自动补当天、通知高度自适应
This commit is contained in:
@@ -335,7 +335,20 @@ object Store {
|
||||
val today = Dates.todayStart()
|
||||
var changed = 0
|
||||
tasks(includeDone = false).forEach { t ->
|
||||
if (!t.repeating || t.due <= 0 || t.due >= today) return@forEach
|
||||
if (!t.repeating) return@forEach
|
||||
// 重复任务没设截止日时没有节奏可循,给它一个今天作为起点,
|
||||
// 否则它既不在「今日」里,也永远不会滚动
|
||||
if (t.due <= 0) {
|
||||
db.update(
|
||||
"tasks",
|
||||
ContentValues().apply { put("due", today) },
|
||||
"_id = ?",
|
||||
arrayOf(t.id.toString()),
|
||||
)
|
||||
changed++
|
||||
return@forEach
|
||||
}
|
||||
if (t.due >= today) return@forEach
|
||||
var due = t.due
|
||||
var guard = 0
|
||||
while (due < today && guard < 500) {
|
||||
|
||||
Reference in New Issue
Block a user