Skip to content

Commit ba74d7e

Browse files
authored
remove isBtnBackFunc logic as not needed
1 parent ed46a27 commit ba74d7e

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

libs/js/banglejs/Bangle_setUI_Q3.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,10 @@
1010
hadBackWidget = true; // if we had a back widget already, don't redraw at the end
1111
WIDGETS.back.remove(options.back); // only redraw when removing if we don't have options.back
1212
}
13-
let clearBtnWatches = function() {
13+
if (Bangle.btnWatches) {
1414
Bangle.btnWatches.forEach(clearWatch);
1515
delete Bangle.btnWatches;
1616
}
17-
if (Bangle.btnWatches) clearBtnWatches();
1817
if (Bangle.swipeHandler) {
1918
Bangle.removeListener("swipe", Bangle.swipeHandler);
2019
delete Bangle.swipeHandler;
@@ -119,14 +118,12 @@
119118
if (options.redraw) // handler for redrawing the UI
120119
Bangle.uiRedraw = options.redraw;
121120
if (options.back) {
122-
let isBtnBackFunc = false;
123121
// only add back button handler if there's no existing watch on BTN1
124122
if (Bangle.btnWatches===undefined) {
125123
Bangle.btnWatches = [ setWatch(function() {
126-
Bangle.btnWatches = undefined;
124+
Bangle.btnWatches = undefined; // watch doesn't repeat
127125
options.back();
128126
}, BTN1, {edge:"rising"}) ];
129-
isBtnBackFunc = true;
130127
}
131128
// if we have widgets loaded *and* visible at the top, add a back widget (see #3788)
132129
if (global.WIDGETS && Bangle.appRect.y) {
@@ -146,7 +143,6 @@
146143
remove:function(noclear){
147144
var w = WIDGETS.back;
148145
if (w.area!="tl") noclear=true; // area="" is set by widget_utils.hide, so avoid drawing
149-
if (isBtnBackFunc && Bangle.btnWatches) clearBtnWatches();
150146
Bangle.removeListener("touch", touchHandler);
151147
if (!noclear) g.reset().clearRect({x:w.x, y:w.y, w:24,h:24});
152148
delete WIDGETS.back;

0 commit comments

Comments
 (0)