drained: always check charge, regardless of boot-disable

pull/2728/head
Rob Pilling 2023-05-07 09:46:22 +01:00
parent 2f084b4c8a
commit 16202c1843
1 changed files with 9 additions and 11 deletions

View File

@ -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();
});