@@ -107,7 +107,7 @@ function showMessageRouter(msg, persist, explicitDestnation) {
107
107
////var active; // active screen (undefined/"list"/"music"/"map"/"overview"/"scroller"/"settings")
108
108
//if (active==undefined) { } else if (active=="list") ... //and so on.
109
109
110
- if ( persist ) { cancelReloadTimeout ( ) ; }
110
+ if ( persist ) { cancelReloadTimeout ( ) ; } else if ( Bangle . isLocked ( ) ) { resetReloadTimeout ( ) ; }
111
111
112
112
if ( msg . id == "music" ) {
113
113
cancelReloadTimeout ( ) ; // don't auto-reload to clock now
@@ -118,16 +118,16 @@ function showMessageRouter(msg, persist, explicitDestnation) {
118
118
return showMapMessage ( msg ) ;
119
119
}
120
120
if ( msg . id == "call" ) {
121
- return showMessageOverview ( msg . id , persist ) ;
121
+ return showMessageOverview ( msg . id ) ;
122
122
}
123
123
if ( "scroller" === explicitDestnation ) {
124
- return showMessagesScroller ( msg , persist ) ;
124
+ return showMessagesScroller ( msg ) ;
125
125
}
126
126
if ( "overview" === explicitDestnation ) {
127
- return showMessageOverview ( msg . id , persist ) ;
127
+ return showMessageOverview ( msg . id ) ;
128
128
}
129
129
if ( "dependsOnActive" === explicitDestnation ) {
130
- if ( "scroller" === active ) { return showMessagesScroller ( msg , persist ) ; } // reinit scroller with updated messages list.
130
+ if ( "scroller" === active ) { return showMessagesScroller ( msg ) ; } // reinit scroller with updated messages list.
131
131
if ( "list" === active ) { return returnToMain ( ) ; }
132
132
if ( "settings" === active || "overview" === active ) { return ; }
133
133
}
@@ -281,13 +281,11 @@ function showMusicMessage(msg) {
281
281
} , 400 ) ;
282
282
}
283
283
284
- function showMessagesScroller ( msg , persist ) {
285
- if ( persist === undefined ) { persist = true ; }
284
+ function showMessagesScroller ( msg ) {
286
285
const MSG_IDX = msg ? MESSAGES . findIndex ( ( m ) => m . id == msg . id ) : undefined ;
287
286
288
287
if ( replying ) { return ; }
289
288
active = "scroller" ;
290
- if ( persist ) { cancelReloadTimeout ( ) ; } else { resetReloadTimeout ( ) ; }
291
289
292
290
const WU = require ( "widget_utils" ) ;
293
291
WU . hide ( ) ;
@@ -408,7 +406,7 @@ function showMessageSettings(msg) {
408
406
active = "settings" ;
409
407
var menu = { "" :{
410
408
"title" :/*LANG*/ "Message" ,
411
- back :( ) => showMessageOverview ( msg . id , true )
409
+ back :( ) => showMessageOverview ( msg . id )
412
410
} ,
413
411
} ;
414
412
@@ -470,9 +468,8 @@ function showMessageSettings(msg) {
470
468
E . showMenu ( menu ) ;
471
469
}
472
470
473
- function showMessageOverview ( msgid , persist ) {
471
+ function showMessageOverview ( msgid ) {
474
472
if ( replying ) { return ; }
475
- if ( ! persist ) resetReloadTimeout ( ) ;
476
473
let idx = MESSAGES . findIndex ( m => m . id == msgid ) ;
477
474
var msg = MESSAGES [ idx ] ;
478
475
if ( updateLabelsInterval ) {
@@ -586,8 +583,8 @@ function showMessageOverview(msgid, persist) {
586
583
Bangle . swipeHandler = ( lr , ud ) => {
587
584
if ( lr > 0 && posHandler ) posHandler ( ) ;
588
585
if ( lr < 0 && negHandler ) negHandler ( ) ;
589
- if ( ud > 0 && idx < MESSAGES . length - 1 ) showMessageOverview ( MESSAGES [ idx + 1 ] . id , true ) ;
590
- if ( ud < 0 && idx > 0 ) showMessageOverview ( MESSAGES [ idx - 1 ] . id , true ) ;
586
+ if ( ud > 0 && idx < MESSAGES . length - 1 ) showMessageOverview ( MESSAGES [ idx + 1 ] . id ) ;
587
+ if ( ud < 0 && idx > 0 ) showMessageOverview ( MESSAGES [ idx - 1 ] . id ) ;
591
588
} ;
592
589
Bangle . on ( "swipe" , Bangle . swipeHandler ) ;
593
590
g . reset ( ) . clearRect ( Bangle . appRect ) ;
@@ -624,7 +621,7 @@ function checkMessages(options) {
624
621
// If we have a new message, show it
625
622
if ( ! options . ignoreUnread && newMessages . length ) {
626
623
delete newMessages [ 0 ] . show ; // stop us getting stuck here if we're called a second time
627
- showMessagesScroller ( newMessages [ 0 ] , persist ) ;
624
+ showMessagesScroller ( newMessages [ 0 ] ) ;
628
625
// buzz after showMessagesScroller, so being busy during scroller setup doesn't affect the buzz pattern
629
626
if ( globalThis . BUZZ_ON_NEW_MESSAGE ) {
630
627
// this is set if we entered the messages app by loading `messagegui.new.js`
@@ -637,7 +634,7 @@ function checkMessages(options) {
637
634
}
638
635
// no new messages: show playing music? Only if we have playing music, or state=="show" (set by messagesmusic)
639
636
if ( options . openMusic && MESSAGES . some ( m => m . id == "music" && ( ( m . track && m . state == "play" ) || m . state == "show" ) ) )
640
- return showMessageOverview ( 'music' , true ) ;
637
+ return showMessageOverview ( 'music' ) ;
641
638
// no new messages - go to clock?
642
639
if ( options . clockIfAllRead && newMessages . length == 0 )
643
640
return load ( ) ;
0 commit comments