From cd1daba0c55e99f5a477407f47b932d050c0b6f2 Mon Sep 17 00:00:00 2001 From: Gordon Williams Date: Wed, 24 Nov 2021 08:46:13 +0000 Subject: [PATCH] 0.25: Fix issue where if Bangle.js 2 got a GPS fix but no reported time, errors could be caused by the widget (fix #935) --- apps.json | 2 +- apps/gpsrec/ChangeLog | 1 + apps/gpsrec/widget.js | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/apps.json b/apps.json index 17180d0e4..837df9f08 100644 --- a/apps.json +++ b/apps.json @@ -661,7 +661,7 @@ { "id": "gpsrec", "name": "GPS Recorder", - "version": "0.24", + "version": "0.25", "description": "Application that allows you to record a GPS track. Can run in background", "icon": "app.png", "tags": "tool,outdoors,gps,widget", diff --git a/apps/gpsrec/ChangeLog b/apps/gpsrec/ChangeLog index c91003914..ca61643a3 100644 --- a/apps/gpsrec/ChangeLog +++ b/apps/gpsrec/ChangeLog @@ -26,3 +26,4 @@ 0.22: Ensure Bangle.setGPSPower uses 'gpsrec' as a tag 0.23: Fix issue where tracks wouldn't record when running from OpenStMap if a period hadn't been set up first 0.24: Better support for Bangle.js 2, avoid widget area for Graphs, smooth graphs more +0.25: Fix issue where if Bangle.js 2 got a GPS fix but no reported time, errors could be caused by the widget (fix #935) diff --git a/apps/gpsrec/widget.js b/apps/gpsrec/widget.js index 6a47f04c5..995f5f73b 100644 --- a/apps/gpsrec/widget.js +++ b/apps/gpsrec/widget.js @@ -26,6 +26,7 @@ fixToggle = !fixToggle; WIDGETS["gpsrec"].draw(); if (hasFix) { + if (fix.time===undefined) fix.time = new Date(); // Bangle.js 2 can provide a fix before time it seems var period = fix.time.getTime() - lastFixTime; if (period+500 > settings.period*1000) { // round up lastFixTime = fix.time.getTime();