diff --git a/apps/messages/ChangeLog b/apps/messages/ChangeLog index 53157f0d8..67c2f903a 100644 --- a/apps/messages/ChangeLog +++ b/apps/messages/ChangeLog @@ -51,3 +51,4 @@ 0.36: Ensure a new message plus an almost immediate deletion of that message doesn't load the messages app (fix #1362) 0.37: Now use the setUI 'back' icon in the top left rather than specific buttons/menu items 0.38: Add telegram foss handling +0.39: Don't turn on the screen after unread timeout expires (#1873) diff --git a/apps/messages/app.js b/apps/messages/app.js index 745f7d208..46f010c0b 100644 --- a/apps/messages/app.js +++ b/apps/messages/app.js @@ -411,19 +411,17 @@ function cancelReloadTimeout() { unreadTimeout = undefined; } - g.clear(); + Bangle.loadWidgets(); Bangle.drawWidgets(); + setTimeout(() => { - var unreadTimeoutSecs = settings.unreadTimeout; - if (unreadTimeoutSecs===undefined) unreadTimeoutSecs=60; - if (unreadTimeoutSecs) - unreadTimeout = setTimeout(function() { - print("Message not seen - reloading"); - load(); - }, unreadTimeoutSecs*1000); + var unreadTimeoutMillis = (settings.unreadTimeout || 60) * 1000; + if (unreadTimeoutMillis) { + unreadTimeout = setTimeout(load, unreadTimeoutMillis); + } // only openMusic on launch if music is new - var newMusic = MESSAGES.some(m=>m.id==="music"&&m.new); - checkMessages({clockIfNoMsg:0,clockIfAllRead:0,showMsgIfUnread:1,openMusic:newMusic&&settings.openMusic}); -},10); // if checkMessages wants to 'load', do that + var newMusic = MESSAGES.some(m => m.id === "music" && m.new); + checkMessages({ clockIfNoMsg: 0, clockIfAllRead: 0, showMsgIfUnread: 1, openMusic: newMusic && settings.openMusic }); +}, 10); // if checkMessages wants to 'load', do that diff --git a/apps/messages/metadata.json b/apps/messages/metadata.json index fd09fdfe4..4bc9f59e4 100644 --- a/apps/messages/metadata.json +++ b/apps/messages/metadata.json @@ -1,7 +1,7 @@ { "id": "messages", "name": "Messages", - "version": "0.38", + "version": "0.39", "description": "App to display notifications from iOS and Gadgetbridge/Android", "icon": "app.png", "type": "app", diff --git a/apps/messages/widget.js b/apps/messages/widget.js index 4b368ffd6..ca02d4f1f 100644 --- a/apps/messages/widget.js +++ b/apps/messages/widget.js @@ -27,7 +27,6 @@ draw:function(recall) { if (quiet) WIDGETS["messages"].t -= 500000; // if quiet, set last time in the past so there is no buzzing WIDGETS["messages"].width=this.iconwidth; Bangle.drawWidgets(); - Bangle.setLCDPower(1);// turns screen on },hide:function() { delete WIDGETS["messages"].t; delete WIDGETS["messages"].l;