fix: reset completed numeric habits from check button
ci / docker (push) Successful in 7m21s

This commit is contained in:
2026-09-07 17:00:43 +08:00
parent a1cb780774
commit 6ca613f5fa
3 changed files with 15 additions and 5 deletions
+5
View File
@@ -70,6 +70,11 @@ export function previousHabitSwipeValue(kind: string | undefined, current: numbe
return 0
}
export function habitButtonValue(kind: string | undefined, current: number | boolean | undefined, target = 1) {
if (isHabitComplete(kind, current, target)) return 0
return nextHabitSwipeValue(kind, current, target)
}
export function numericHabitInputValue(input: number | string | undefined) {
if (input === undefined || input === '') return null
const value = Number(input)