File tree Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 117
117
Remove workaround for 2v10 (>3 years ago) - assume everyone is on never firmware now
118
118
0.86: Default to showing message scroller (with title, bigger icon)
119
119
0.87: Make choosing of font size more repeatable
120
- 0.88: Adjust padding calculation so messages are spaced out properly even when using international fonts
120
+ 0.88: Adjust padding calculation so messages are spaced out properly even when using international fonts
121
+ 0.89: Fix bugs related to empty titles and bodies
Original file line number Diff line number Diff line change @@ -361,12 +361,12 @@ function showMessage(msgid, persist) {
361
361
active = "message" ;
362
362
// Normal text message display
363
363
let src = msg . src || /*LANG*/ "Message" , srcFont = fontSmall ;
364
- let title = msg . title , titleFont = fontLarge , lines ;
364
+ let title = msg . title || "" , titleFont = fontLarge , lines = [ ] ;
365
365
let body = msg . body , bodyFont = fontLarge ;
366
366
// If no body, use the title text instead...
367
- if ( body === undefined ) {
367
+ if ( ! body ) {
368
368
body = title ;
369
- title = undefined ;
369
+ title = "" ;
370
370
}
371
371
if ( g . setFont ( srcFont ) . stringWidth ( src ) > g . getWidth ( ) - 52 )
372
372
srcFont = "4x6" ;
@@ -392,6 +392,8 @@ function showMessage(msgid, persist) {
392
392
}
393
393
lines = g . setFont ( bodyFont ) . wrapString ( body , w ) ;
394
394
}
395
+ // By this point, `title` must be a string and `lines` must be an array of strings.
396
+ // Either or both can be empty, but neither can be `undefined` (#3969).
395
397
let negHandler , posHandler , rowLeftDraw , rowRightDraw ;
396
398
if ( msg . negative ) {
397
399
negHandler = ( ) => {
Original file line number Diff line number Diff line change 2
2
"id" : " messagegui" ,
3
3
"name" : " Message UI" ,
4
4
"shortName" : " Messages" ,
5
- "version" : " 0.88 " ,
5
+ "version" : " 0.89 " ,
6
6
"description" : " Default app to display notifications from iOS and Gadgetbridge/Android" ,
7
7
"icon" : " app.png" ,
8
8
"type" : " app" ,
You can’t perform that action at this time.
0 commit comments