fix update

This commit is contained in:
2026-04-18 01:43:52 +02:00
parent 7af7b1c1ae
commit 19f8561862
+3 -4
View File
@@ -2,7 +2,7 @@ import { statusItem } from "glimpseui";
import refresh from "./handlers/refresh.mjs";
import { base } from "./helpers/html.mjs";
import { log } from "./helpers/logger.mjs";
import { differenceInDays } from "date-fns";
import { isToday } from "date-fns";
import open from "open";
let lastDate = new Date();
@@ -20,10 +20,9 @@ app.on("message", (message) => {
case "ready":
interval = setInterval(() => {
log("Checking for new reading...");
const now = new Date();
if (Math.abs(differenceInDays(now, lastDate)) >= 1) {
if (!isToday(lastDate)) {
refresh(app);
lastDate = now;
lastDate = new Date();
log("Updated reading for date:", lastDate);
}