File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -270,12 +270,26 @@ E.showMenu = ((items?: Menu): MenuInstance | void => {
270270 remove : ( ) => {
271271 if ( nameScroller ) clearInterval ( nameScroller ) ;
272272 Bangle . removeListener ( "swipe" , onSwipe ) ;
273+ if ( is2v26_27 )
274+ Bangle . removeListener ( "touch" , touchcb ) ;
273275 options . remove ?.( ) ;
274276 } ,
275- touch : touchcb ,
276- } as SetUIArg < "updown" > ;
277+ } satisfies SetUIArg < "updown" > ;
278+
279+ const is2v26_27 = process . env . VERSION === "2v26" || process . env . VERSION === "2v27" ;
280+ if ( ! is2v26_27 ) {
281+ // no need for workaround
282+ ( uiopts as any ) . touch = touchcb ;
283+ }
277284
278285 Bangle . setUI ( uiopts , cb ) ;
279286
287+ if ( is2v26_27 ) {
288+ // work around:
289+ // - https://github.com/espruino/Espruino/issues/2648
290+ // - https://github.com/orgs/espruino/discussions/7697#discussioncomment-13782299
291+ Bangle . on ( "touch" , touchcb ) ;
292+ }
293+
280294 return l ;
281295} ) as typeof E . showMenu ;
You can’t perform that action at this time.
0 commit comments