diff --git a/apps/messagegui/ChangeLog b/apps/messagegui/ChangeLog index d849e9b6fd..48d5234fe9 100644 --- a/apps/messagegui/ChangeLog +++ b/apps/messagegui/ChangeLog @@ -117,4 +117,5 @@ Remove workaround for 2v10 (>3 years ago) - assume everyone is on never firmware now 0.86: Default to showing message scroller (with title, bigger icon) 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 \ No newline at end of file +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 diff --git a/apps/messagegui/app.js b/apps/messagegui/app.js index 7dcfec866d..5b30957304 100644 --- a/apps/messagegui/app.js +++ b/apps/messagegui/app.js @@ -361,12 +361,12 @@ function showMessage(msgid, persist) { active = "message"; // Normal text message display let src=msg.src||/*LANG*/"Message", srcFont = fontSmall; - let title=msg.title, titleFont = fontLarge, lines; + let title=msg.title||"", titleFont = fontLarge, lines=[]; let body=msg.body, bodyFont = fontLarge; // If no body, use the title text instead... - if (body===undefined) { + if (!body) { body = title; - title = undefined; + title = ""; } if (g.setFont(srcFont).stringWidth(src) > g.getWidth()-52) srcFont = "4x6"; @@ -392,6 +392,8 @@ function showMessage(msgid, persist) { } lines = g.setFont(bodyFont).wrapString(body, w); } + // By this point, `title` must be a string and `lines` must be an array of strings. + // Either or both can be empty, but neither can be `undefined` (#3969). let negHandler,posHandler,rowLeftDraw,rowRightDraw; if (msg.negative) { negHandler = ()=>{ diff --git a/apps/messagegui/metadata.json b/apps/messagegui/metadata.json index db54edb7e8..8ef38bd063 100644 --- a/apps/messagegui/metadata.json +++ b/apps/messagegui/metadata.json @@ -2,7 +2,7 @@ "id": "messagegui", "name": "Message UI", "shortName": "Messages", - "version": "0.88", + "version": "0.89", "description": "Default app to display notifications from iOS and Gadgetbridge/Android", "icon": "app.png", "type": "app",