feat(app): add diagnostics and update runtime

This commit is contained in:
Codex
2026-06-06 20:42:34 +07:00
parent 925181a3b7
commit 7c40558cd3
23 changed files with 2232 additions and 2792 deletions

View File

@@ -47,7 +47,7 @@ let cache: PersistedState | null = null
let storePath = ''
let pendingWrite: NodeJS.Timeout | null = null
function getStorePath(): string {
export function getStorePath(): string {
if (!storePath) {
const dir = app.getPath('userData')
if (!existsSync(dir)) mkdirSync(dir, { recursive: true })
@@ -197,7 +197,8 @@ function sanitizeMeal(raw: unknown, now = Date.now()): Meal | null {
const meal: Meal = {
...base,
id,
nextFireAt: finiteMs(raw.nextFireAt) ?? nextMealOccurrence(base.time, base.days, now)
nextFireAt:
finiteMs(raw.nextFireAt) ?? nextMealOccurrence(base.time, base.days, now)
}
const lastDoneAt = finiteMs(raw.lastDoneAt)
if (lastDoneAt !== undefined) meal.lastDoneAt = lastDoneAt