From 594d08bf60edf8bd2cfc92cdd91801fc13a0ef0e Mon Sep 17 00:00:00 2001 From: Rob Pilling Date: Sun, 22 Sep 2024 21:55:26 +0100 Subject: [PATCH] sched/clkinfo: schedule an alarm via `setAlarm` ... to ensure timers are scheduled from now --- apps/sched/clkinfo.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/sched/clkinfo.js b/apps/sched/clkinfo.js index a336c988d..8a5576181 100644 --- a/apps/sched/clkinfo.js +++ b/apps/sched/clkinfo.js @@ -127,9 +127,13 @@ run: function() { if (a.date) return; // ignore events a.on = !a.on; + if (a.on) { + // use sched to start the alarm, + // so it takes care of timers etc + alarm.setAlarm(a.id, a); + } this.emit("redraw"); - alarm.setAlarms(all); - alarm.reload(); + alarm.reload(); // schedule/unschedule the alarm } })), };