mirror of https://github.com/espruino/BangleApps
Use let instead of const on object that get updated
parent
59ee5b1a78
commit
9b71b107cf
|
@ -1,9 +1,9 @@
|
|||
(function () {
|
||||
|
||||
// load variable before defining functions cause it can trigger a ReferenceError
|
||||
const activityreminder = require("activityreminder");
|
||||
const storage = require("Storage");
|
||||
const activityreminder_settings = activityreminder.loadSettings();
|
||||
const activityreminder_data = activityreminder.loadData();
|
||||
let activityreminder_data = activityreminder.loadData();
|
||||
|
||||
function drawAlert() {
|
||||
E.showPrompt("Inactivity detected", {
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
(function () {
|
||||
|
||||
// load variable before defining functions cause it can trigger a ReferenceError
|
||||
const activityreminder = require("activityreminder");
|
||||
const activityreminder_settings = activityreminder.loadSettings();
|
||||
if (activityreminder_settings.enabled) {
|
||||
const activityreminder_data = activityreminder.loadData();
|
||||
let activityreminder_data = activityreminder.loadData();
|
||||
if (activityreminder_data.firstLoad) {
|
||||
activityreminder_data.firstLoad = false;
|
||||
activityreminder.saveData(activityreminder_data);
|
||||
|
|
|
@ -21,7 +21,7 @@ exports.saveData = function (data) {
|
|||
|
||||
exports.loadData = function () {
|
||||
let health = Bangle.getHealthStatus("day");
|
||||
const data = Object.assign({
|
||||
let data = Object.assign({
|
||||
firstLoad: true,
|
||||
stepsDate: new Date(),
|
||||
stepsOnDate: health.steps,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
(function (back) {
|
||||
// Load settings
|
||||
const activityreminder = require("activityreminder");
|
||||
const settings = activityreminder.loadSettings();
|
||||
let settings = activityreminder.loadSettings();
|
||||
|
||||
// Show the menu
|
||||
E.showMenu({
|
||||
|
|
Loading…
Reference in New Issue