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/app.js b/apps/iconlaunch/app.js index 479956019..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(); @@ -133,6 +132,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 +182,7 @@ drag: onDrag, touch: (_, e) => { if (e.y < R.y - 4) return; + updateTimeout(); let i = YtoIdx(e.y); selectItem(i, e); }, @@ -202,16 +203,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); } 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",