Update widget.js

* Fix loading of settings
* Do not draw widget if `hide` is true
pull/1029/head
Marco H 2021-12-08 11:30:21 +01:00 committed by GitHub
parent b6b7aa8a46
commit b017a3e91b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -6,8 +6,7 @@
let settings;
function loadSettings() {
const d = require('Storage').readJSON('weather.json', 1) || {};
settings = d.settings || {};
settings = require('Storage').readJSON('weather.json', 1) || {};
}
function setting(key) {
@ -48,6 +47,7 @@
area: "tl",
width: weather.get() && !setting('hide') ? 20 : 0,
draw: function() {
if (setting('hide')) return;
const w = weather.get();
if (!w) return;
g.reset();