From ddaba6db78b2ee4a5fe423d8ee32ab7a2127fc25 Mon Sep 17 00:00:00 2001 From: thyttan <6uuxstm66@mozmail.com⁩> Date: Sun, 31 Aug 2025 00:51:30 +0200 Subject: [PATCH 1/3] messagegui: cancel/resume unread timeout on lock event fixes #3941 --- apps/messagegui/ChangeLog | 2 ++ apps/messagegui/app.js | 14 ++++++++++++-- apps/messagegui/metadata.json | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/apps/messagegui/ChangeLog b/apps/messagegui/ChangeLog index 48d5234fe9..81eb0eebab 100644 --- a/apps/messagegui/ChangeLog +++ b/apps/messagegui/ChangeLog @@ -119,3 +119,5 @@ 0.87: Make choosing of font size more repeatable 0.88: Adjust padding calculation so messages are spaced out properly even when using international fonts 0.89: Fix bugs related to empty titles and bodies +0.90: Interrupt unread timeout if the user has unlocked the screen, resume on + screen locked (fix #3941) diff --git a/apps/messagegui/app.js b/apps/messagegui/app.js index 5b30957304..61ce17d816 100644 --- a/apps/messagegui/app.js +++ b/apps/messagegui/app.js @@ -646,8 +646,18 @@ setTimeout(() => { }, 10); // if checkMessages wants to 'load', do that /* If the Bangle is unlocked by the user, treat that -as a queue to stop repeated buzzing */ +as a queue to stop repeated buzzing. +Also suspend the reload timeout while the watch is unlocked. */ +let isTimeoutSuspended; Bangle.on('lock',locked => { - if (!locked) + if (!locked) { require("messages").stopBuzz(); + isTimeoutSuspended = !!unreadTimeout; + cancelReloadTimeout(); + } + if (locked) + if (isTimeoutSuspended) { + resetReloadTimeout(); + isTimeoutSuspended = false; + } }); diff --git a/apps/messagegui/metadata.json b/apps/messagegui/metadata.json index 8ef38bd063..a1752355d8 100644 --- a/apps/messagegui/metadata.json +++ b/apps/messagegui/metadata.json @@ -2,7 +2,7 @@ "id": "messagegui", "name": "Message UI", "shortName": "Messages", - "version": "0.89", + "version": "0.90", "description": "Default app to display notifications from iOS and Gadgetbridge/Android", "icon": "app.png", "type": "app", From 29133b5ee275444d4998be1b09426d9ad3e7cca5 Mon Sep 17 00:00:00 2001 From: thyttan <97237430+thyttan@users.noreply.github.com> Date: Sun, 31 Aug 2025 10:52:04 +0200 Subject: [PATCH 2/3] Update apps/messagegui/app.js Co-authored-by: Rob Pilling --- apps/messagegui/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/messagegui/app.js b/apps/messagegui/app.js index 61ce17d816..c5467bfc0f 100644 --- a/apps/messagegui/app.js +++ b/apps/messagegui/app.js @@ -646,7 +646,7 @@ setTimeout(() => { }, 10); // if checkMessages wants to 'load', do that /* If the Bangle is unlocked by the user, treat that -as a queue to stop repeated buzzing. +as a cue to stop repeated buzzing. Also suspend the reload timeout while the watch is unlocked. */ let isTimeoutSuspended; Bangle.on('lock',locked => { From c7b9c40deba3151d614ce3b467d3efc536448879 Mon Sep 17 00:00:00 2001 From: thyttan <97237430+thyttan@users.noreply.github.com> Date: Sun, 31 Aug 2025 23:43:51 +0200 Subject: [PATCH 3/3] Update apps/messagegui/app.js Co-authored-by: Rob Pilling --- apps/messagegui/app.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/apps/messagegui/app.js b/apps/messagegui/app.js index c5467bfc0f..b582098f81 100644 --- a/apps/messagegui/app.js +++ b/apps/messagegui/app.js @@ -654,9 +654,7 @@ Bangle.on('lock',locked => { require("messages").stopBuzz(); isTimeoutSuspended = !!unreadTimeout; cancelReloadTimeout(); - } - if (locked) - if (isTimeoutSuspended) { + } else if (isTimeoutSuspended) { resetReloadTimeout(); isTimeoutSuspended = false; }