File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change 118
118
if ( options . redraw ) // handler for redrawing the UI
119
119
Bangle . uiRedraw = options . redraw ;
120
120
if ( options . back ) {
121
- var btnWatch ;
122
121
// only add back button handler if there's no existing watch on BTN1
123
- if ( Bangle . btnWatches === undefined )
124
- btnWatch = setWatch ( function ( ) {
125
- btnWatch = undefined ;
122
+ if ( Bangle . btnWatches === undefined ) {
123
+ Bangle . btnWatches = [ setWatch ( function ( ) {
124
+ Bangle . btnWatches = undefined ; // watch doesn't repeat
126
125
options . back ( ) ;
127
- } , BTN1 , { edge :"rising" } ) ;
126
+ } , BTN1 , { edge :"rising" } ) ] ;
127
+ }
128
128
// if we have widgets loaded *and* visible at the top, add a back widget (see #3788)
129
129
if ( global . WIDGETS && Bangle . appRect . y ) {
130
130
// add our own touch handler for touching in the top left
143
143
remove :function ( noclear ) {
144
144
var w = WIDGETS . back ;
145
145
if ( w . area != "tl" ) noclear = true ; // area="" is set by widget_utils.hide, so avoid drawing
146
- if ( btnWatch ) clearWatch ( btnWatch ) ;
147
146
Bangle . removeListener ( "touch" , touchHandler ) ;
148
147
if ( ! noclear ) g . reset ( ) . clearRect ( { x :w . x , y :w . y , w :24 , h :24 } ) ;
149
148
delete WIDGETS . back ;
You can’t perform that action at this time.
0 commit comments