From 37b1e38e7fe9702c6d98fb56774fb0f291ca4bd4 Mon Sep 17 00:00:00 2001 From: jeffmer Date: Tue, 2 Nov 2021 12:52:22 +0000 Subject: [PATCH] fix minute tick bug --- apps.json | 2 +- apps/multiclock/ChangeLog | 1 + apps/multiclock/multiclock.app.js | 9 +++++---- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/apps.json b/apps.json index 305e5255b..31184e954 100644 --- a/apps.json +++ b/apps.json @@ -2683,7 +2683,7 @@ { "id": "multiclock", "name": "Multi Clock", - "version": "0.07", + "version": "0.08", "description": "Clock with multiple faces. Switch between faces with BTN1 & BTN3 or swipe left-right. For best display set theme Background 2 to cyan or some other bright colour in settings.", "icon": "multiclock.png", "type": "clock", diff --git a/apps/multiclock/ChangeLog b/apps/multiclock/ChangeLog index f40f04031..9d02ae85e 100644 --- a/apps/multiclock/ChangeLog +++ b/apps/multiclock/ChangeLog @@ -5,6 +5,7 @@ 0.05: make Bangle compatible 0.06: add minute tick for efficiency and nifty A clock 0.07: compatible with Bang;e.js 2 +0.08: fix minute tick bug diff --git a/apps/multiclock/multiclock.app.js b/apps/multiclock/multiclock.app.js index 126802500..c24e5c94b 100644 --- a/apps/multiclock/multiclock.app.js +++ b/apps/multiclock/multiclock.app.js @@ -14,11 +14,12 @@ function stopdraw() { g.clear(); } -function queueMinuteTick(f) { - if (tickTimeout) clearTimeout(drawTimeout); +function queueMinuteTick() { + if (tickTimeout) clearTimeout(tickTimeout); tickTimeout = setTimeout(function() { tickTimeout = undefined; - f(); + face.tick(); + queueMinuteTick(); }, 60000 - (Date.now() % 60000)); } @@ -28,7 +29,7 @@ function startdraw() { if (face.tickpersec) intervalRefSec = setInterval(face.tick,1000); else - queueMinuteTick(face.tick); + queueMinuteTick(); Bangle.drawWidgets(); }