diff --git a/apps/sleeplog/ChangeLog b/apps/sleeplog/ChangeLog index 93202b291..7d2f147db 100644 --- a/apps/sleeplog/ChangeLog +++ b/apps/sleeplog/ChangeLog @@ -10,4 +10,5 @@ 0.12: Improve README, option to add functions triggered by status changes or time periods, remove old log (<0.10) conversion 0.13: Prevent to stay in consecutive sleep if not worn, correct trigger calling, add trigger object itself as argument to the fn function 0.14: Add "Delete all logfiles before" to interface.html, display all logfiles in the interface -0.15: Issue newline before GB commands (solves issue with console.log and ignored commands) \ No newline at end of file +0.15: Issue newline before GB commands (solves issue with console.log and ignored commands) +0.16: Only write logs if we have a non-empty log to write diff --git a/apps/sleeplog/lib.js b/apps/sleeplog/lib.js index 8aa1748b1..79d7db0d5 100644 --- a/apps/sleeplog/lib.js +++ b/apps/sleeplog/lib.js @@ -169,7 +169,8 @@ exports = { // check if before this fortnight period if (firstDay < thisFirstDay) { // write log in seperate file - require("Storage").writeJSON("sleeplog_" + this.msToFn(firstDay) + ".log", log); + if(log.length > 0) + require("Storage").writeJSON("sleeplog_" + this.msToFn(firstDay) + ".log", log); // set last day as first firstDay = lastDay; } else { diff --git a/apps/sleeplog/metadata.json b/apps/sleeplog/metadata.json index 911e0cfa1..212c47ff3 100644 --- a/apps/sleeplog/metadata.json +++ b/apps/sleeplog/metadata.json @@ -2,7 +2,7 @@ "id":"sleeplog", "name":"Sleep Log", "shortName": "SleepLog", - "version": "0.15", + "version": "0.16", "description": "Log and view your sleeping habits. This app is using the built in movement calculation.", "icon": "app.png", "type": "app",