diff --git a/apps/health/ChangeLog b/apps/health/ChangeLog index fb97552b1..aa4578c65 100644 --- a/apps/health/ChangeLog +++ b/apps/health/ChangeLog @@ -18,3 +18,4 @@ 0.17: Add automatic translation of bar chart labels 0.18: Show step goal in daily step chart 0.19: Can show notification when daily step goal is reached +0.20: Fix the settings page, it would not update settings correctly. diff --git a/apps/health/metadata.json b/apps/health/metadata.json index 704101138..ee8bb1af3 100644 --- a/apps/health/metadata.json +++ b/apps/health/metadata.json @@ -2,7 +2,7 @@ "id": "health", "name": "Health Tracking", "shortName": "Health", - "version": "0.19", + "version": "0.20", "description": "Logs health data and provides an app to view it", "icon": "app.png", "tags": "tool,system,health", diff --git a/apps/health/settings.js b/apps/health/settings.js index e7b0a7c15..4fb0f9e93 100644 --- a/apps/health/settings.js +++ b/apps/health/settings.js @@ -5,6 +5,9 @@ stepGoalNotification: false }, require("Storage").readJSON("health.json", true) || {}); + function setSettings() { + require("Storage").writeJSON("health.json", settings); + } E.showMenu({ "": { title: /*LANG*/"Health Tracking" }, @@ -22,7 +25,7 @@ ][v], onchange: v => { settings.hrm = v; - setSettings(settings); + setSettings(); } }, @@ -33,7 +36,7 @@ step: 250, onchange: v => { settings.stepGoal = v; - setSettings(settings); + setSettings(); } }, /*LANG*/"Step Goal Notification": { @@ -45,8 +48,4 @@ } } }); - - function setSettings(settings) { - require("Storage").writeJSON("health.json", settings); - } })