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.14: Use ClockFace_menu.addItems
0.15: Add Power saving option 0.15: Add Power saving option
0.16: Support Fast Loading 0.16: Support Fast Loading
0.17: Hide widgets instead of not loading them at all

View File

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

View File

@ -1,5 +1,10 @@
(function(back) { (function(back) {
let s = require("Storage").readJSON("barclock.settings.json", true) || {}; 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) { function save(key, value) {
s[key] = value; s[key] = value;
@ -19,7 +24,7 @@
}; };
let items = { let items = {
showDate: s.showDate, 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) // Power saving for Bangle.js 1 doesn't make sense (no updates while screen is off anyway)
if (process.env.HWVERSION>1) { if (process.env.HWVERSION>1) {