From 50b94d6870d32856d08c6a044563c9a65b8a6cdc Mon Sep 17 00:00:00 2001 From: Marco H Date: Fri, 11 Feb 2022 13:16:59 +0100 Subject: [PATCH 1/3] Update boot.js Fixes Uncaught Error: Expecting a string, got undefined see https://github.com/espruino/BangleApps/issues/1423 --- apps/sleeplog/boot.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/sleeplog/boot.js b/apps/sleeplog/boot.js index 7ec71742c..883e497a5 100644 --- a/apps/sleeplog/boot.js +++ b/apps/sleeplog/boot.js @@ -90,7 +90,10 @@ if (global.sleeplog.enabled) { var storage = require("Storage"); // 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 if (log.length > 0 && log[0][1] === 0 && From ee104a2e8a1f29160df90fe46f285572c55913e3 Mon Sep 17 00:00:00 2001 From: Marco H Date: Fri, 11 Feb 2022 13:45:01 +0100 Subject: [PATCH 2/3] Update ChangeLog --- apps/sleeplog/ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/sleeplog/ChangeLog b/apps/sleeplog/ChangeLog index 5560f00bc..7dee1a116 100644 --- a/apps/sleeplog/ChangeLog +++ b/apps/sleeplog/ChangeLog @@ -1 +1,2 @@ 0.01: New App! +0.02: Fix crash on start From 47d7aced6513ec197a8a58c7b8ca74b9dededaa8 Mon Sep 17 00:00:00 2001 From: Marco H Date: Fri, 11 Feb 2022 13:45:10 +0100 Subject: [PATCH 3/3] Update metadata.json --- apps/sleeplog/metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/sleeplog/metadata.json b/apps/sleeplog/metadata.json index 4a67af301..f4590f7c0 100644 --- a/apps/sleeplog/metadata.json +++ b/apps/sleeplog/metadata.json @@ -2,7 +2,7 @@ "id":"sleeplog", "name":"Sleep Log", "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).", "icon": "app.png", "type": "app",