Skip to content

Commit ddaba6d

Browse files
author
thyttan
committed
messagegui: cancel/resume unread timeout on lock event
fixes #3941
1 parent 0f9139c commit ddaba6d

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

apps/messagegui/ChangeLog

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,3 +119,5 @@
119119
0.87: Make choosing of font size more repeatable
120120
0.88: Adjust padding calculation so messages are spaced out properly even when using international fonts
121121
0.89: Fix bugs related to empty titles and bodies
122+
0.90: Interrupt unread timeout if the user has unlocked the screen, resume on
123+
screen locked (fix #3941)

apps/messagegui/app.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -646,8 +646,18 @@ setTimeout(() => {
646646
}, 10); // if checkMessages wants to 'load', do that
647647

648648
/* If the Bangle is unlocked by the user, treat that
649-
as a queue to stop repeated buzzing */
649+
as a queue to stop repeated buzzing.
650+
Also suspend the reload timeout while the watch is unlocked. */
651+
let isTimeoutSuspended;
650652
Bangle.on('lock',locked => {
651-
if (!locked)
653+
if (!locked) {
652654
require("messages").stopBuzz();
655+
isTimeoutSuspended = !!unreadTimeout;
656+
cancelReloadTimeout();
657+
}
658+
if (locked)
659+
if (isTimeoutSuspended) {
660+
resetReloadTimeout();
661+
isTimeoutSuspended = false;
662+
}
653663
});

apps/messagegui/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"id": "messagegui",
33
"name": "Message UI",
44
"shortName": "Messages",
5-
"version": "0.89",
5+
"version": "0.90",
66
"description": "Default app to display notifications from iOS and Gadgetbridge/Android",
77
"icon": "app.png",
88
"type": "app",

0 commit comments

Comments
 (0)