[widalarmeta] move "Only on clock" check to top of draw
parent
d31c6ca12a
commit
7fc876237d
|
|
@ -39,6 +39,13 @@
|
|||
} // getNextAlarm
|
||||
|
||||
function draw(_w, fromInterval) {
|
||||
|
||||
// If only show on clock and not on clock
|
||||
if (config.whenToShow === 1 && !Bangle.CLOCK) {
|
||||
this.nextAlarm = undefined; // make sure to reload later
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.nextAlarm === undefined) {
|
||||
let alarm = getNextAlarm();
|
||||
if (alarm === undefined) {
|
||||
|
|
@ -56,9 +63,6 @@
|
|||
let calcWidth = 0;
|
||||
let drawSeconds = false;
|
||||
|
||||
// If always showing, or the clock is visible
|
||||
if (config.whenToShow === 1 && !Bangle.CLOCK)
|
||||
return;
|
||||
// Determine text and width
|
||||
if (next > 0 && next <= config.maxhours*60*60*1000) {
|
||||
const hours = Math.floor((next-1) / 3600000).toString();
|
||||
|
|
@ -100,7 +104,6 @@
|
|||
this.bellVisible = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (this.width !== calcWidth) {
|
||||
// width changed, re-layout
|
||||
|
|
|
|||
Loading…
Reference in New Issue