From 76c296f44d6bdfefd2413ff2ded62393e6dd8730 Mon Sep 17 00:00:00 2001 From: Rob Pilling Date: Mon, 22 Apr 2024 18:38:44 +0100 Subject: [PATCH] multitimer: handle undefined alarm.data --- apps/multitimer/ChangeLog | 2 ++ apps/multitimer/boot.js | 2 +- apps/multitimer/metadata.json | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/multitimer/ChangeLog b/apps/multitimer/ChangeLog index 8bf06a0d3..0facd0a26 100644 --- a/apps/multitimer/ChangeLog +++ b/apps/multitimer/ChangeLog @@ -8,3 +8,5 @@ menu display/fastload removes it 0.08: Add setting for initial page to display 0.09: Minor code improvements +0.10: Handle missing alarm data, e.g. when our reset is fired from + non-multitimer alarms diff --git a/apps/multitimer/boot.js b/apps/multitimer/boot.js index 70b9032f6..bfd8c6ac9 100644 --- a/apps/multitimer/boot.js +++ b/apps/multitimer/boot.js @@ -1,6 +1,6 @@ { const resetTimer = alarm => { - if (alarm.timer) alarm.timer = alarm.data.ot; + if (alarm.timer && "ot" in alarm.data) alarm.timer = alarm.data.ot; }; Bangle.on("alarmSnooze", resetTimer); diff --git a/apps/multitimer/metadata.json b/apps/multitimer/metadata.json index a5c236f67..b1cdcb34d 100644 --- a/apps/multitimer/metadata.json +++ b/apps/multitimer/metadata.json @@ -1,7 +1,7 @@ { "id": "multitimer", "name": "Multi Timer", - "version": "0.09", + "version": "0.10", "description": "Set timers and chronographs (stopwatches) and watch them count down in real time. Pause, create, edit, and delete timers and chronos, and add custom labels/messages. Also sets alarms.", "icon": "app.png", "screenshots": [