barclock: ClockFace update: Hide widgets instead of not loading them

pull/2469/head
Richard de Boer 2023-01-07 16:58:03 +01:00
parent a4a3d678dd
commit 99c575f09b
No known key found for this signature in database
3 changed files with 8 additions and 2 deletions

View File

@ -14,3 +14,4 @@
0.14: Use ClockFace_menu.addItems
0.15: Add Power saving option
0.16: Support Fast Loading
0.17: Hide widgets instead of not loading them at all

View File

@ -1,7 +1,7 @@
{
"id": "barclock",
"name": "Bar Clock",
"version": "0.16",
"version": "0.17",
"description": "A simple digital clock showing seconds as a bar",
"icon": "clock-bar.png",
"screenshots": [{"url":"screenshot.png"},{"url":"screenshot_pm.png"}],

View File

@ -1,5 +1,10 @@
(function(back) {
let s = require("Storage").readJSON("barclock.settings.json", true) || {};
// migrate "don't load widgets" to "hide widgets"
if (!("hideWidgets" in s) && ("loadWidgets" in s) && !s.loadWidgets) {
s.hideWidgets = 1;
}
delete s.loadWidgets;
function save(key, value) {
s[key] = value;
@ -19,7 +24,7 @@
};
let items = {
showDate: s.showDate,
loadWidgets: s.loadWidgets,
hideWidgets: s.hideWidgets,
};
// Power saving for Bangle.js 1 doesn't make sense (no updates while screen is off anyway)
if (process.env.HWVERSION>1) {