From f43b1e6ee394f5f49a21ae7261928d96c69ed8be Mon Sep 17 00:00:00 2001 From: Markus Date: Tue, 14 Apr 2020 21:02:39 +0200 Subject: [PATCH] PrevDay lgging fixed --- apps/batchart/widget.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/batchart/widget.js b/apps/batchart/widget.js index 0565f4160..2ef54e997 100644 --- a/apps/batchart/widget.js +++ b/apps/batchart/widget.js @@ -14,8 +14,8 @@ WIDGETS = {}; var batChartFile; // file for battery percentage recording const recordingInterval10Min = 60 * 10 * 1000; - const recordingInterval1Min = 60*1000; //For testing - const recordingInterval10S = 10*1000; //For testing + const recordingInterval1Min = 60*1000; //For testing + const recordingInterval10S = 10*1000; //For testing var recordingInterval = null; var compassEventReceived = false; @@ -67,7 +67,7 @@ WIDGETS = {}; enabledConsumers = enabledConsumers | switchableConsumers.hrm; //if (Bangle.isBluetoothOn()) // enabledConsumers = enabledConsumers | switchableConsumers.bluetooth; - + // Reset the event registration vars compassEventReceived = false; gpsEventReceived = false; @@ -84,7 +84,8 @@ WIDGETS = {}; const logFileName = "bclog" + currentWriteDay; // Change log target on day change - if (previousWriteDay != currentWriteDay) { + if (previousWriteDay != NaN + && previousWriteDay != currentWriteDay) { //Remove a log file containing data from a week ago Storage.open(logFileName, "r").erase(); Storage.open(previousWriteLogName, "w").write(parseInt(currentWriteDay)); @@ -110,6 +111,7 @@ WIDGETS = {}; reload(); Bangle.drawWidgets(); // relayout all widgets }}; + // load settings, set correct widget width reload(); })() \ No newline at end of file