Skip to content

Commit 5ae4723

Browse files
committed
promenu: workaround 2v2[67] bug - use separate touch handler
See: - 8b2e5a5 - https://github.com/orgs/espruino/discussions/7697#discussioncomment-13782299 - espruino/Espruino#2648 (comment)
1 parent 25af19d commit 5ae4723

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

apps/promenu/bootb2.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff 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;

0 commit comments

Comments
 (0)