tinyhead: fix the touch handler

pull/3635/head
michele 2024-11-01 17:51:37 +01:00
parent 71f3f69304
commit 9306de32eb
1 changed files with 5 additions and 2 deletions

View File

@ -22,6 +22,7 @@
let helpShown = false;
let tapCount = 0;
let centerX, centerY, minuteHandLength, hourHandLength, handOutline;
let originalTheme = Object.assign({}, g.theme);
// Open the eyes and schedule the next blink
let blinkOpen = function blinkOpen() {
@ -229,13 +230,14 @@
activeEyesNum = disconnectedEyes;
}
Bangle.setUI("clock", {
Bangle.setUI({
mode:"custom",
clock: true,
touch: (button, xy) => {
// Go direct to feature select in settings on long screen press
if (xy.type == 2) {
eval(require("Storage").read("tinyheads.settings.js"))(()=> {
g.setTheme(originalTheme);
E.showMenu();
init();
}, true, helpShown);
@ -253,6 +255,7 @@
}
},
remove: function() {
g.setTheme(originalTheme);
// Clear timeouts and listeners for fast loading
if (drawTimeout) clearTimeout(drawTimeout);
if (blinkTimeout) clearTimeout(blinkTimeout);