Merge pull request #1425 from myxor/patch-2

sleeplog: fix #1423
master
Gordon Williams 2022-02-11 13:32:45 +00:00 committed by GitHub
commit dad13c8087
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 2 deletions

View File

@ -1 +1,2 @@
0.01: New App! 0.01: New App!
0.02: Fix crash on start

View File

@ -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 &&

View File

@ -2,7 +2,7 @@
"id":"sleeplog", "id":"sleeplog",
"name":"Sleep Log", "name":"Sleep Log",
"shortName": "SleepLog", "shortName": "SleepLog",
"version": "0.01", "version": "0.02",
"description": "Log and view your sleeping habits. This app derived from SleepPhaseAlarm and uses also the principe of Estimation of Stationary Sleep-segments (ESS).", "description": "Log and view your sleeping habits. This app derived from SleepPhaseAlarm and uses also the principe of Estimation of Stationary Sleep-segments (ESS).",
"icon": "app.png", "icon": "app.png",
"type": "app", "type": "app",