Use let instead of const on object that get updated

pull/1951/head
Stiralbios 2022-06-12 20:05:32 +02:00
parent 59ee5b1a78
commit 9b71b107cf
4 changed files with 6 additions and 6 deletions

View File

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

View File

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

View File

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

View File

@ -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({