alarm: fix uncaught error if no scroller (Bangle 1)

pull/3605/head
thyttan 2024-10-07 20:43:04 +02:00
parent 8ae59c8db6
commit 1f6195f2d5
3 changed files with 5 additions and 3 deletions

View File

@ -51,3 +51,5 @@
0.46: Show alarm groups if the Show Group setting is ON. Scroll alarms menu back to previous position when getting back to it.
0.47: Fix wrap around when snoozed through midnight
0.48: Use datetimeinput for Events, if available. Scroll back when getting out of group. Menu date format setting for shorter dates on current year.
0.49: fix uncaught error if no scroller (Bangle 1). Would happen when trying
to select an alarm in the main menu.

View File

@ -94,7 +94,7 @@ function showMainMenu(scroll, group, scrollback) {
if(showAlarm) {
menu[trimLabel(getLabel(e),40)] = {
value: e.on ? (e.timer ? iconTimerOn : iconAlarmOn) : (e.timer ? iconTimerOff : iconAlarmOff),
onchange: () => setTimeout(e.timer ? showEditTimerMenu : showEditAlarmMenu, 10, e, index, undefined, scroller.scroll, group)
onchange: () => setTimeout(e.timer ? showEditTimerMenu : showEditAlarmMenu, 10, e, index, undefined, scroller?scroller.scroll:undefined, group)
};
} else if (getGroups) {
groups[e.group] = undefined;
@ -102,7 +102,7 @@ function showMainMenu(scroll, group, scrollback) {
});
if (!group) {
Object.keys(groups).sort().forEach(g => menu[g] = () => showMainMenu(null, g, scroller.scroll));
Object.keys(groups).sort().forEach(g => menu[g] = () => showMainMenu(null, g, scroller?scroller.scroll:undefined));
menu[/*LANG*/"Advanced"] = () => showAdvancedMenu();
}

View File

@ -2,7 +2,7 @@
"id": "alarm",
"name": "Alarms & Timers",
"shortName": "Alarms",
"version": "0.48",
"version": "0.49",
"description": "Set alarms and timers on your Bangle",
"icon": "app.png",
"tags": "tool,alarm",