qmsched: fix #1117

Properly check WIDGETS is set before redrawing the widget
pull/1128/head
Richard de Boer 2021-12-17 17:42:53 +01:00
parent a8ccc840b7
commit d8398d73a3
3 changed files with 4 additions and 3 deletions

View File

@ -3896,7 +3896,7 @@
"id": "qmsched",
"name": "Quiet Mode Schedule and Widget",
"shortName": "Quiet Mode",
"version": "0.05",
"version": "0.06",
"description": "Automatically turn Quiet Mode on or off at set times, and change LCD options while Quiet Mode is active.",
"icon": "app.png",
"screenshots": [{"url":"screenshot_b1_main.png"},{"url":"screenshot_b1_edit.png"},{"url":"screenshot_b1_lcd.png"},

View File

@ -2,4 +2,5 @@
0.02: Add widget
0.03: Bangle.js 2 support
0.04: Move Quiet Mode LCD options from global settings to this app
0.05: Avoid immediately redrawing widgets on load
0.05: Avoid immediately redrawing widgets on load
0.06: Fix: don't try to redraw widget when widgets not loaded

View File

@ -19,5 +19,5 @@ exports.setMode = function(mode) {
{quiet:mode}
));
exports.applyOptions(mode);
if (WIDGETS && "qmsched" in WIDGETS) WIDGETS["qmsched"].draw();
if (typeof WIDGETS === "object" && "qmsched" in WIDGETS) WIDGETS["qmsched"].draw();
};