Merge pull request #2809 from bobrippling/dtlaunch-back

swiperclocklaunch: remove extra listeners in setUI()
master
Gordon Williams 2023-06-12 09:22:08 +01:00 committed by GitHub
commit 5fe670cd4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 1 deletions

View File

@ -2,3 +2,4 @@
0.02: Fix issue with mode being undefined
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

View File

@ -1,7 +1,13 @@
(function() {
var sui = Bangle.setUI;
var oldSwipe;
Bangle.setUI = function(mode, cb) {
if (oldSwipe && oldSwipe !== Bangle.swipeHandler)
Bangle.removeListener("swipe", oldSwipe);
sui(mode,cb);
oldSwipe = Bangle.swipeHandler;
if(!mode) return;
if ("object"==typeof mode) mode = mode.mode;
if (mode.startsWith("clock")) {

View File

@ -1,7 +1,7 @@
{
"id": "swiperclocklaunch",
"name": "Swiper Clock Launch",
"version": "0.04",
"version": "0.05",
"description": "Navigate between clock and launcher with Swipe action",
"icon": "swiperclocklaunch.png",
"type": "bootloader",