drained: load self on startup
this allows us to then control restoring normal operationmaster
parent
a28891e6df
commit
c7aa2b3655
|
|
@ -8,9 +8,14 @@ drainedInterval = setInterval(() => {
|
||||||
if(E.getBattery() > threshold)
|
if(E.getBattery() > threshold)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(disableBoot)
|
const app = "drained.app.js";
|
||||||
require("Storage").erase(".boot0");
|
|
||||||
|
|
||||||
load("drained.app.js");
|
if(disableBoot)
|
||||||
|
require("Storage").write(
|
||||||
|
".boot0",
|
||||||
|
`if(typeof __FILE__ === "undefined" || __FILE__ !== "${app}") setTimeout(load, 100, "${app}");`
|
||||||
|
);
|
||||||
|
|
||||||
|
load(app);
|
||||||
}, interval * 60 * 1000);
|
}, interval * 60 * 1000);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue