From 16202c1843d313496a01c6ce3e2feff02a22439b Mon Sep 17 00:00:00 2001 From: Rob Pilling Date: Sun, 7 May 2023 09:46:22 +0100 Subject: [PATCH] drained: always check charge, regardless of boot-disable --- apps/drained/app.ts | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/apps/drained/app.ts b/apps/drained/app.ts index 9fc2665ee..22e173b46 100644 --- a/apps/drained/app.ts +++ b/apps/drained/app.ts @@ -112,16 +112,14 @@ function drainedRestore() { // "public", to allow users to call load(); // necessary after updating boot.0 } -if(disableBoot){ - const checkCharge = () => { - if(E.getBattery() < restore) return; - drainedRestore(); - }; +const checkCharge = () => { + if(E.getBattery() < restore) return; + drainedRestore(); +}; - if (Bangle.isCharging()) - checkCharge(); +if (Bangle.isCharging()) + checkCharge(); - Bangle.on("charging", charging => { - if(charging) checkCharge(); - }); -} +Bangle.on("charging", charging => { + if(charging) checkCharge(); +});