fix: clarify completed habit reset notice
ci / docker (push) Successful in 4m5s

This commit is contained in:
2026-09-08 10:52:56 +08:00
parent c8abb75cf4
commit 8fa0418fa2
3 changed files with 16 additions and 3 deletions
+6
View File
@@ -75,6 +75,12 @@ export function habitButtonValue(kind: string | undefined, current: number | boo
return nextHabitSwipeValue(kind, current, target)
}
export function habitButtonNotice(kind: string | undefined, previous: number | boolean | undefined, next: number | boolean) {
if (kind === 'numeric' && Number(previous ?? 0) > 0 && Number(next) === 0) return '今日进度已重置'
if (kind !== 'numeric' && Number(previous ?? 0) > 0 && Number(next) === 0) return '已取消完成'
return Number(next) > Number(previous ?? 0) ? '已记录一次 🎉' : '已减少一次'
}
export function numericHabitInputValue(input: number | string | undefined) {
if (input === undefined || input === '') return null
const value = Number(input)