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)

master
Gordon Williams 2021-11-24 08:46:13 +00:00
parent c03ab08687
commit cd1daba0c5
3 changed files with 3 additions and 1 deletions

View File

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

View File

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

View File

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