From f508f66c57072ae20199bf4d6670a2a0cc433d45 Mon Sep 17 00:00:00 2001 From: thyttan <6uuxstm66@mozmail.com⁩> Date: Wed, 17 Apr 2024 23:10:56 +0200 Subject: [PATCH] clock_info: prepend swipe listener if possible --- apps/clock_info/ChangeLog | 1 + apps/clock_info/lib.js | 2 +- apps/clock_info/metadata.json | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/clock_info/ChangeLog b/apps/clock_info/ChangeLog index a4c25f995..21ac47c3f 100644 --- a/apps/clock_info/ChangeLog +++ b/apps/clock_info/ChangeLog @@ -8,3 +8,4 @@ 0.07: Developer tweak: clkinfo load errors are emitted 0.08: Pass options to show(), hide() and run(), and add focus() and blur() item methods 0.09: Save clkinfo settings on kill and remove +0.10: Prepend swipe listener if possible diff --git a/apps/clock_info/lib.js b/apps/clock_info/lib.js index 7b4e49b5c..9999db260 100644 --- a/apps/clock_info/lib.js +++ b/apps/clock_info/lib.js @@ -286,7 +286,7 @@ exports.addInteractive = function(menu, options) { // On 2v18+ firmware we can stop other event handlers from being executed since we handled this E.stopEventPropagation&&E.stopEventPropagation(); } - Bangle.on("swipe",swipeHandler); + if (Bangle.prependListener) {Bangle.prependListener("swipe",swipeHandler);} else {Bangle.on("swipe",swipeHandler);} const blur = () => { options.focus=false; delete Bangle.CLKINFO_FOCUS; diff --git a/apps/clock_info/metadata.json b/apps/clock_info/metadata.json index d2a5540e1..7d6c042f9 100644 --- a/apps/clock_info/metadata.json +++ b/apps/clock_info/metadata.json @@ -1,7 +1,7 @@ { "id": "clock_info", "name": "Clock Info Module", "shortName": "Clock Info", - "version":"0.09", + "version":"0.10", "description": "A library used by clocks to provide extra information on the clock face (Altitude, BPM, etc)", "icon": "app.png", "type": "module",