Skip to content

Commit 2fe3d5f

Browse files
authored
Merge pull request #4186 from ticalc-travis/tevtimer
tevtimer version 0.02
2 parents 6a27a17 + 7e9c795 commit 2fe3d5f

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

apps/tevtimer/ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
0.01: Official release
2+
0.02: Fix misbehavior if multiple alarms become active at once

apps/tevtimer/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ The on-screen menu button displays the following menu items:
3030
The following parameters can be adjusted individually for each timer by displaying that timer on the main screen and then selecting **Edit** from the menu:
3131

3232
* **Name:** (available when a keyboard app is installed) Allows you to assign a custom name to the timer to display in menus
33-
* **Start:** Set the starting time of the timer
33+
* **Start:** Set the starting time of the countdown timer. You can also set this to zero to create a simple stopwatch that counts upward instead of downward (when the timer is running, a dash will appear to the left of the time to indicate this).
3434
* **At end:** Allows for creating interval or repeat timers. Selecting “Stop” causes the timer to simply stop when it expires and the resulting alert is dismissed. Selecting a timer here will cause the selected timer to reset and automatically begin counting down once this timer expires. See “Chained timers” below.
3535
* **Vibrate pattern:** Choose the vibration pattern for the alert when the timer expires
3636
* **Buzz count:** Choose the number of times the vibration pattern signals when the timer expires before silencing itself

apps/tevtimer/alarm.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,14 @@ function showAlarm(alarm) {
145145
buzz();
146146
}
147147

148+
148149
let alarms = require("sched").getAlarms();
149-
let active = require("sched").getActiveAlarms(alarms);
150-
if (active.length) {
151-
// if there's an alarm, show it
152-
showAlarm(active[0]);
150+
let activeAlarm = require("sched").getActiveAlarms(alarms).find(
151+
alarm => alarm.appid === 'tevtimer'
152+
);
153+
154+
if (activeAlarm !== undefined) {
155+
showAlarm(activeAlarm);
153156
} else {
154-
// otherwise just go back to default app
155157
setTimeout(load, 100);
156158
}

apps/tevtimer/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"name": "tev's timer",
44
"shortName":"tev's timer",
55
"icon": "app.png",
6-
"version": "0.01",
6+
"version": "0.02",
77
"description": "A countdown timer app with interval and repeat features",
88
"screenshots": [ {"url": "screenshot.png" } ],
99
"readme": "README.md",

0 commit comments

Comments
 (0)