Update boot.js
Fixes Uncaught Error: Expecting a string, got undefined see https://github.com/espruino/BangleApps/issues/1423master
parent
615519350a
commit
50b94d6870
|
|
@ -90,7 +90,10 @@ if (global.sleeplog.enabled) {
|
||||||
var storage = require("Storage");
|
var storage = require("Storage");
|
||||||
|
|
||||||
// read previous logfile
|
// read previous logfile
|
||||||
var log = JSON.parse(atob(storage.read(this.logfile)));
|
var logContent = storage.read(this.logfile) || "";
|
||||||
|
|
||||||
|
// parse previous logfile
|
||||||
|
var log = JSON.parse(logContent.length > 0 ? atob(logContent) : "[]") ;
|
||||||
|
|
||||||
// remove last state if it was unknown and is less then 10min ago
|
// remove last state if it was unknown and is less then 10min ago
|
||||||
if (log.length > 0 && log[0][1] === 0 &&
|
if (log.length > 0 && log[0][1] === 0 &&
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue