Skip to content

Commit c2217c3

Browse files
author
thyttan
committed
messagegui: fixes and memory optimisation for Bangle.js 1
Don't add widget utils as it's currently broken for Bangle.js 1 (keeps widget utils for Bangle.js 2). Delete some variables before trying to navigate to a message overview from the messages scroller.
1 parent 57e422b commit c2217c3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

apps/messagegui/app.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,8 @@ function showMessagesScroller(msg) {
287287
if (replying) { return; }
288288
active = "scroller";
289289

290-
const WU = require("widget_utils");
291-
WU.hide();
290+
const WU = 1!==process.env.HWVERSION ? require("widget_utils") : undefined;
291+
WU&&WU.hide();
292292
const APP_RECT = Bangle.appRect;
293293

294294
var bodyFont = fontBig;
@@ -340,7 +340,8 @@ function showMessagesScroller(msg) {
340340
for (let i=firstTitleLinePerMsg.length-1; i>=0 ; i--) {
341341
if (scrollIdx>=firstTitleLinePerMsg[i]) {
342342
if (!touch || touch.type===0) {
343-
WU.show();
343+
WU&&WU.show();
344+
delete titleLines, allLines;
344345
showMessageRouter(MESSAGES[i], true, "overview");
345346
updateReadMessages();
346347
}

0 commit comments

Comments
 (0)