From c36e3587c527e149f380d42c507c51a3cf7f2407 Mon Sep 17 00:00:00 2001 From: Rob Pilling Date: Mon, 10 Jul 2023 22:11:06 +0100 Subject: [PATCH] swiperclocklaunch: check `mode` after pulling from `options` --- apps/swiperclocklaunch/ChangeLog | 1 + apps/swiperclocklaunch/boot.js | 3 ++- apps/swiperclocklaunch/metadata.json | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/swiperclocklaunch/ChangeLog b/apps/swiperclocklaunch/ChangeLog index f62e10940..a341ee512 100644 --- a/apps/swiperclocklaunch/ChangeLog +++ b/apps/swiperclocklaunch/ChangeLog @@ -3,3 +3,4 @@ 0.03: Update setUI to work with new Bangle.js 2v13 menu style 0.04: Update to work with new 'fast switch' clock->launcher functionality 0.05: Keep track of event listeners we "overwrite", and remove them at the start of setUI +0.06: Handle apps that call setUI({}) to reset diff --git a/apps/swiperclocklaunch/boot.js b/apps/swiperclocklaunch/boot.js index 11abb84c9..bb033891e 100644 --- a/apps/swiperclocklaunch/boot.js +++ b/apps/swiperclocklaunch/boot.js @@ -8,8 +8,9 @@ sui(mode,cb); oldSwipe = Bangle.swipeHandler; - if(!mode) return; if ("object"==typeof mode) mode = mode.mode; + if (!mode) return; + if (mode.startsWith("clock")) { // clock -> launcher Bangle.swipeHandler = dir => { if (dir<0) Bangle.showLauncher(); }; diff --git a/apps/swiperclocklaunch/metadata.json b/apps/swiperclocklaunch/metadata.json index d46c56693..436d36868 100644 --- a/apps/swiperclocklaunch/metadata.json +++ b/apps/swiperclocklaunch/metadata.json @@ -1,7 +1,7 @@ { "id": "swiperclocklaunch", "name": "Swiper Clock Launch", - "version": "0.05", + "version": "0.06", "description": "Navigate between clock and launcher with Swipe action", "icon": "swiperclocklaunch.png", "type": "bootloader",