From bf5f56b7fc5380a873d9fe5e632551c036ef7a04 Mon Sep 17 00:00:00 2001 From: xxDUxx <96152564+xxDUxx@users.noreply.github.com> Date: Mon, 11 Sep 2023 00:31:43 +0200 Subject: [PATCH 1/4] Update app.js --- apps/contourclock/app.js | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/apps/contourclock/app.js b/apps/contourclock/app.js index 407203e6c..5a75e1581 100644 --- a/apps/contourclock/app.js +++ b/apps/contourclock/app.js @@ -29,14 +29,17 @@ } let showExtras = function() { //show extras for a limited time drawExtras(); - if (extrasTimeout) clearTimeout(extrasTimeout); + //if (extrasTimeout) clearTimeout(extrasTimeout); extrasTimeout = setTimeout(() => { extrasTimeout = undefined; hideExtras(); }, 5000); + extrasShown = false; }; let drawExtras = function() { //draw date, day of the week and widgets let date = new Date(); + g.reset(); + g.clearRect(0, 138, g.getWidth() - 1, 176); g.setFont("Teletext10x18Ascii").setFontAlign(0, 1); if (settings.weekday) g.drawString(require("locale").dow(date).toUpperCase(), g.getWidth() / 2, g.getHeight() - 18); if (settings.date) g.drawString(require('locale').date(date, 1), g.getWidth() / 2, g.getHeight()); @@ -45,21 +48,23 @@ }; let hideExtras = function() { if (extrasTimeout) clearTimeout(extrasTimeout); + extrasTimeout = undefined; //NEW + g.reset(); g.clearRect(0, 138, g.getWidth() - 1, 176); require("widget_utils").hide(); - extrasShown = false; + extrasShown = false; ///NEW }; let draw = function() { + if (drawTimeout) clearTimeout(drawTimeout); //NEW + drawTimeout = setTimeout(function() { + drawTimeout = undefined; + draw(); + }, 60000 - (Date.now() % 60000)); let date = new Date(); g.reset(); if (extrasShown) drawExtras(); else hideExtras(); require('contourclock').drawClock(settings.fontIndex); - if (drawTimeout) clearTimeout(drawTimeout); - drawTimeout = setTimeout(function() { - drawTimeout = undefined; - draw(); - }, 60000 - (Date.now() % 60000)); }; if (settings.hideWhenLocked) { onLock = locked => { @@ -83,6 +88,8 @@ Bangle.removeListener('twist', showExtras); if (drawTimeout) clearTimeout(drawTimeout); if (extrasTimeout) clearTimeout(extrasTimeout); + drawTimeout = undefined; + extrasTimeout = undefined; if (settings.hideWhenLocked) require("widget_utils").show(); g.reset(); g.clear(); @@ -91,7 +98,7 @@ g.clear(); if (settings.widgets) { Bangle.loadWidgets(); - Bangle.drawWidgets(); + setTimeout(Bangle.drawWidgets,0); //NEW } draw(); } From 10b642ea44c35ed872fe0e87541e7c999a31ea2b Mon Sep 17 00:00:00 2001 From: xxDUxx <96152564+xxDUxx@users.noreply.github.com> Date: Mon, 11 Sep 2023 00:34:29 +0200 Subject: [PATCH 2/4] Update ChangeLog --- apps/contourclock/ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/contourclock/ChangeLog b/apps/contourclock/ChangeLog index d13b16702..2fa26b89a 100644 --- a/apps/contourclock/ChangeLog +++ b/apps/contourclock/ChangeLog @@ -10,3 +10,4 @@ 0.28: More config options for cleaner look, enabled fast loading 0.29: Fixed a bug that would leave old font files in storage. 0.30: Added options to show widgets and date on twist and tap. New fonts. +0.31: Bugfix, no more freeze. From c9ce0a967b8b0f8d2fca60fb9ef483f5fda20dd3 Mon Sep 17 00:00:00 2001 From: xxDUxx <96152564+xxDUxx@users.noreply.github.com> Date: Mon, 11 Sep 2023 00:34:46 +0200 Subject: [PATCH 3/4] Update metadata.json --- apps/contourclock/metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/contourclock/metadata.json b/apps/contourclock/metadata.json index ca5ee114f..5c97ce933 100644 --- a/apps/contourclock/metadata.json +++ b/apps/contourclock/metadata.json @@ -1,7 +1,7 @@ { "id": "contourclock", "name": "Contour Clock", "shortName" : "Contour Clock", - "version":"0.30", + "version":"0.31", "icon": "app.png", "readme": "README.md", "description": "A Minimalist clockface with large Digits.", From e0b262249b1e90c721583efa82d5cd731193c5e9 Mon Sep 17 00:00:00 2001 From: xxDUxx <96152564+xxDUxx@users.noreply.github.com> Date: Thu, 14 Sep 2023 14:04:15 +0200 Subject: [PATCH 4/4] Update app.js --- apps/contourclock/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/contourclock/app.js b/apps/contourclock/app.js index 5a75e1581..1a510f014 100644 --- a/apps/contourclock/app.js +++ b/apps/contourclock/app.js @@ -29,7 +29,7 @@ } let showExtras = function() { //show extras for a limited time drawExtras(); - //if (extrasTimeout) clearTimeout(extrasTimeout); + if (extrasTimeout) clearTimeout(extrasTimeout); extrasTimeout = setTimeout(() => { extrasTimeout = undefined; hideExtras();