forked from FOSS/BangleApps
clock_info: remove redundant focus call
parent
1d6457ed19
commit
0943d20231
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue