diff --git a/apps/pebbled/ChangeLog b/apps/pebbled/ChangeLog index a0127ffce8..9f57341521 100644 --- a/apps/pebbled/ChangeLog +++ b/apps/pebbled/ChangeLog @@ -3,3 +3,4 @@ 0.03: Swipe down to see widgets Support for fast loading 0.04: Localisation request: added Miles and AM/PM +0.05: Prevent exceptions from halting the draw cycle diff --git a/apps/pebbled/metadata.json b/apps/pebbled/metadata.json index 8924e600af..483f6e0d36 100644 --- a/apps/pebbled/metadata.json +++ b/apps/pebbled/metadata.json @@ -2,7 +2,7 @@ "id": "pebbled", "name": "Pebble Clock with distance", "shortName": "Pebble + distance", - "version": "0.04", + "version": "0.05", "description": "Fork of Pebble Clock with distance in KM. Both step count and the distance are on the main screen. Default step length = 0.75m (can be changed in settings).", "readme": "README.md", "icon": "pebbled.png", diff --git a/apps/pebbled/pebbled.app.js b/apps/pebbled/pebbled.app.js index 54b56712ce..c90a8d2e72 100644 --- a/apps/pebbled/pebbled.app.js +++ b/apps/pebbled/pebbled.app.js @@ -37,6 +37,13 @@ const h3 = 7*h/8 - 10; let batteryWarning = false; let draw = function() { + // queue next draw + if (drawTimeout) clearTimeout(drawTimeout); + drawTimeout = setTimeout(function() { + drawTimeout = undefined; + draw(); + }, 60000 - (Date.now() % 60000)); + let date = new Date(); let da = date.toString().split(" "); let timeStr = settings.localization === "US" ? tConv24(da[4].substr(0,5)) : da[4].substr(0,5); @@ -101,13 +108,6 @@ let draw = function() { else g.setColor('#000'); // otherwise black regardless of theme g.drawString(distanceStr, w/2, ha + 107); - - // queue next draw - if (drawTimeout) clearTimeout(drawTimeout); - drawTimeout = setTimeout(function() { - drawTimeout = undefined; - draw(); - }, 60000 - (Date.now() % 60000)); }; // at x,y width:wi thicknes:th