diff --git a/apps/lightswitch/ChangeLog b/apps/lightswitch/ChangeLog index 4f62ab7999..398d146e0c 100644 --- a/apps/lightswitch/ChangeLog +++ b/apps/lightswitch/ChangeLog @@ -5,3 +5,4 @@ 0.05: Prevent drawing into app area. 0.06: Fix issue where .draw was being called by reference (not allowing widgets to be hidden) 0.07: Handle the swipe event that is generated when draging to change light intensity, so it doesn't trigger some other swipe handler. +0.08: Ensure boot code doesn't allocate and leave a gloval variable named 'settings' \ No newline at end of file diff --git a/apps/lightswitch/boot.js b/apps/lightswitch/boot.js index d57679b565..dba51bce18 100644 --- a/apps/lightswitch/boot.js +++ b/apps/lightswitch/boot.js @@ -1,5 +1,6 @@ +{ // load settings -var settings = Object.assign({ +let settings = Object.assign({ value: 1, isOn: true }, require("Storage").readJSON("lightswitch.json", true) || {}); @@ -12,6 +13,4 @@ Bangle.removeListener("tap", require("lightswitch.js").tapListener); // add tap listener to unlock and/or flash backlight if (settings.unlockSide || settings.tapSide) Bangle.on("tap", require("lightswitch.js").tapListener); - -// clear variable -settings = undefined; +} diff --git a/apps/lightswitch/metadata.json b/apps/lightswitch/metadata.json index f1f0160b88..f33f6d1cbf 100644 --- a/apps/lightswitch/metadata.json +++ b/apps/lightswitch/metadata.json @@ -2,7 +2,7 @@ "id": "lightswitch", "name": "Light Switch Widget", "shortName": "Light Switch", - "version": "0.07", + "version": "0.08", "description": "A fast way to switch LCD backlight on/off, change the brightness and show the lock status. All in one widget.", "icon": "images/app.png", "screenshots": [