Delete global settings var after brightness change to `0`, to free up memory

master
RKBoss6 2025-07-28 15:12:02 -04:00 committed by GitHub
parent 0040159926
commit 5398b5e442
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -13,7 +13,8 @@
s.brightness = 0;
if (!("lcdTimeout" in s)) s.lcdTimeout = 5; // fallback so logic doesn't break
require("Storage").writeJSON("setting.json", s);
//remove large settings object from memory
s=null;
const longPressTime=400; //(ms)
Bangle.on('lock', function(isLocked) {