widalarmeta: don't show for hidden alarms

pull/2542/head
Rob Pilling 2023-01-29 23:02:50 +00:00
parent bddef2ef0f
commit 70a4371cf4
1 changed files with 6 additions and 1 deletions

View File

@ -8,7 +8,12 @@
}, require("Storage").readJSON("widalarmeta.json",1) || {});
function draw() {
const times = alarms.map(alarm => require("sched").getTimeToAlarm(alarm)).filter(a => a !== undefined);
const times = alarms
.map(alarm => {
alarm.hidden !== true
&& require("sched").getTimeToAlarm(alarm)
})
.filter(a => a !== undefined);
const next = Math.min.apply(null, times);
let calcWidth = 0;
let drawSeconds = false;