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