From 599f20aca93934e7b84e06d957ca42000033cd28 Mon Sep 17 00:00:00 2001 From: Brendan Hubble Date: Tue, 29 Mar 2022 18:59:05 +1100 Subject: [PATCH] touchtimer: FIX countdown buzz to be in last 5 seconds - The countdown buzz was happening on each minute and not only on the last 5 seconds --- apps/touchtimer/ChangeLog | 1 + apps/touchtimer/app.js | 7 ++++++- apps/touchtimer/metadata.json | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/touchtimer/ChangeLog b/apps/touchtimer/ChangeLog index 0969a3da4..f81907152 100644 --- a/apps/touchtimer/ChangeLog +++ b/apps/touchtimer/ChangeLog @@ -2,3 +2,4 @@ 0.02: Add settings menu 0.03: Add ability to repeat last timer 0.04: Add 5 second count down buzzer +0.05: Fix 5 second count down buzzer to be only in the final 5 seconds diff --git a/apps/touchtimer/app.js b/apps/touchtimer/app.js index c2f2fb5e9..18c07feef 100644 --- a/apps/touchtimer/app.js +++ b/apps/touchtimer/app.js @@ -129,7 +129,12 @@ var main = () => { // Buzz lightly when there are less then 5 seconds left if (settings.countDownBuzz) { var remainingSeconds = timerCountDown.getAdjustedTime().seconds; - if (remainingSeconds <= 5 && remainingSeconds > 0) { + var remainingMinutes = timerCountDown.getAdjustedTime().minutes; + var remainingHours = timerCountDown.getAdjustedTime().hours; + if ( remainingSeconds <= 5 + && remainingSeconds > 0 + && remainingMinutes <= 0 + && remainingHours <= 0) { Bangle.buzz(); } } diff --git a/apps/touchtimer/metadata.json b/apps/touchtimer/metadata.json index 0f2b9f491..9261f3619 100644 --- a/apps/touchtimer/metadata.json +++ b/apps/touchtimer/metadata.json @@ -2,7 +2,7 @@ "id": "touchtimer", "name": "Touch Timer", "shortName": "Touch Timer", - "version": "0.04", + "version": "0.05", "description": "Quickly and easily create a timer with touch-only input. The time can be easily set with a number pad.", "icon": "app.png", "tags": "tools",