From 81632cda7efca73e7fef1be515cc6b0e550fec12 Mon Sep 17 00:00:00 2001 From: Martin Boonk Date: Sun, 6 Nov 2022 12:42:11 +0100 Subject: [PATCH 1/3] iconlaunch - Cleanup and reset timeout as needed --- apps/iconlaunch/app.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/apps/iconlaunch/app.js b/apps/iconlaunch/app.js index 479956019..e7cf34840 100644 --- a/apps/iconlaunch/app.js +++ b/apps/iconlaunch/app.js @@ -133,6 +133,7 @@ g.flip(); const itemsN = Math.ceil(launchCache.apps.length / appsN); let onDrag = function(e) { + updateTimeout(); g.setColor(g.theme.fg); g.setBgColor(g.theme.bg); let dy = e.dy; @@ -182,6 +183,7 @@ drag: onDrag, touch: (_, e) => { if (e.y < R.y - 4) return; + updateTimeout(); let i = YtoIdx(e.y); selectItem(i, e); }, @@ -202,16 +204,23 @@ delete idxToY; delete YtoIdx; delete settings; + if (timeout) clearTimeout(timeout); setTimeout(eval, 0, s.read(".bootcde")); }; if (settings.oneClickExit) mode.btn = returnToClock; + + let timeout; + const updateTimeout = function(){ if (settings.timeOut!="Off"){ let time=parseInt(settings.timeOut); //the "s" will be trimmed by the parseInt - setTimeout(returnToClock,time*1000); + if (timeout) clearTimeout(timeout); + timeout = setTimeout(returnToClock,time*1000); + } } + updateTimeout(); Bangle.setUI(mode); } From d3286bab65bb59fb8cdecf63217a6fd238b66029 Mon Sep 17 00:00:00 2001 From: Martin Boonk Date: Sun, 6 Nov 2022 14:20:55 +0100 Subject: [PATCH 2/3] iconlaunch - Bump version --- apps/iconlaunch/ChangeLog | 2 ++ apps/iconlaunch/metadata.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/iconlaunch/ChangeLog b/apps/iconlaunch/ChangeLog index c71da1467..b0fcaf856 100644 --- a/apps/iconlaunch/ChangeLog +++ b/apps/iconlaunch/ChangeLog @@ -12,3 +12,5 @@ used Object.assing for the settings fix cache not deleted when "showClocks" options is changed added timeOut to return to the clock +0.11: Cleanup timeout when changing to clock + Reset timeout on swipe and drag diff --git a/apps/iconlaunch/metadata.json b/apps/iconlaunch/metadata.json index 13e7aee08..8154d830a 100644 --- a/apps/iconlaunch/metadata.json +++ b/apps/iconlaunch/metadata.json @@ -2,7 +2,7 @@ "id": "iconlaunch", "name": "Icon Launcher", "shortName" : "Icon launcher", - "version": "0.10", + "version": "0.11", "icon": "app.png", "description": "A launcher inspired by smartphones, with an icon-only scrollable menu.", "tags": "tool,system,launcher", From cc6b296b095e3630b423aaa113ff69165f5e7440 Mon Sep 17 00:00:00 2001 From: Martin Boonk Date: Sun, 6 Nov 2022 22:51:08 +0100 Subject: [PATCH 3/3] iconlaunch - Remove console log output --- apps/iconlaunch/app.js | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/iconlaunch/app.js b/apps/iconlaunch/app.js index e7cf34840..a7b89996a 100644 --- a/apps/iconlaunch/app.js +++ b/apps/iconlaunch/app.js @@ -9,7 +9,6 @@ timeOut:"Off" }, s.readJSON("iconlaunch.json", true) || {}); - console.log(settings); if (!settings.fullscreen) { Bangle.loadWidgets(); Bangle.drawWidgets();