fix settings.js

pull/2470/head
thyttan 2023-01-07 18:14:58 +01:00
parent 059a2e7af7
commit 4ce840a60f
3 changed files with 7 additions and 7 deletions

View File

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

View File

@ -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",

View File

@ -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);
}
})