Update widget.js

master
Phil Roggenbuck 2023-02-14 15:54:06 +01:00 committed by GitHub
parent 1485ee8624
commit 1c9d62fe0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 3 deletions

View File

@ -6,6 +6,7 @@
let settings;
function loadSettings() { // stolen from https://github.com/espruino/BangleApps/blob/master/apps/widpedom/widget.js
try {
const d = require('Storage').readJSON("widbgjs.settings.json", 1) || {};
settings = Object.assign({
'unitIsMmol': true,
@ -14,6 +15,9 @@
'hide': false
}, d || {});
return d;
} catch(e){
return null;
}
}
function loadVals() {
@ -103,9 +107,9 @@
function draw() {
loadSettings();
try {
if (settings.hide) return;
} catch (e) { }
if(settings.hide) {
return;
}
loadVals();
outpt = getBG(storedData.bg);