Fix settings and crash when no weather is available
parent
31ced9ea24
commit
e0d86d60d8
|
|
@ -148,7 +148,10 @@ function draw() {
|
|||
if (tempString) g.drawString(tempString, w, h2 + dowOffset);
|
||||
|
||||
const code = weather ? weather.code : -1;
|
||||
g.drawImage(getWeatherIconByCode(code, true), w - 64, h1);
|
||||
if (code > -1) {
|
||||
const icon = getWeatherIconByCode(code, true);
|
||||
if (icon) g.drawImage(icon, w - 48, h1, {scale:0.75});
|
||||
}
|
||||
}
|
||||
|
||||
drawCircle(1);
|
||||
|
|
|
|||
|
|
@ -70,9 +70,9 @@
|
|||
onchange: x => save('updateInterval', x),
|
||||
},
|
||||
/*LANG*/'show big weather': {
|
||||
value: settings[showBigWeather] || false,
|
||||
format: () => (settings[showBigWeather] ? 'Yes' : 'No'),
|
||||
onchange: x => save(showBigWeather, x),
|
||||
value: !!settings.showBigWeather,
|
||||
format: () => (settings.showBigWeather ? 'Yes' : 'No'),
|
||||
onchange: x => save('showBigWeather', x),
|
||||
}
|
||||
};
|
||||
E.showMenu(menu);
|
||||
|
|
|
|||
Loading…
Reference in New Issue