1
0
Fork 0

clock_info: remove redundant focus call

master
Rob Pilling 2024-03-12 07:39:00 +00:00
parent 1d6457ed19
commit 0943d20231
1 changed files with 3 additions and 4 deletions

View File

@ -293,7 +293,8 @@ exports.addInteractive = function(menu, options) {
redraw = false; redraw = false;
if (redraw) options.redraw(); if (redraw) options.redraw();
}; };
const focus = (redraw) => { const focus = () => {
let redraw = true;
Bangle.CLKINFO_FOCUS=true; Bangle.CLKINFO_FOCUS=true;
if (!options.focus) { if (!options.focus) {
options.focus=true; options.focus=true;
@ -313,12 +314,10 @@ exports.addInteractive = function(menu, options) {
return; // outside area return; // outside area
} }
if (!options.focus) { if (!options.focus) {
focus(true); focus();
} else if (menu[options.menuA].items[options.menuB].run) { } else if (menu[options.menuA].items[options.menuB].run) {
Bangle.buzz(100, 0.7); Bangle.buzz(100, 0.7);
menu[options.menuA].items[options.menuB].run(options); // allow tap on an item to run it (eg home assistant) menu[options.menuA].items[options.menuB].run(options); // allow tap on an item to run it (eg home assistant)
} else {
focus();
} }
}; };
Bangle.on("touch",touchHandler); Bangle.on("touch",touchHandler);