Refactor to remove the (apparently spurious) `Error: Unreachable point. logically broken.` warning during minification

pull/3173/head
Gordon Williams 2024-01-30 16:36:44 +00:00
parent 168a018b00
commit d8ada3f734
1 changed files with 3 additions and 5 deletions

View File

@ -47,7 +47,7 @@ exports.cleanup = function() {
Bangle.drawWidgets = exports.origDraw;
delete exports.origDraw;
}
}
};
/** Put widgets offscreen, and allow them to be swiped
back onscreen with a downwards swipe. Use .show to undo.
@ -87,8 +87,7 @@ exports.swipeOn = function(autohide) {
else Bangle.setLCDOverlay();
}
for (var w of global.WIDGETS) {
if (w._draw) continue; // already hidden
for (var w of global.WIDGETS) if (!w._draw) { // already hidden
w._draw = w.draw;
w.draw = function() {
g=og;
@ -139,10 +138,9 @@ exports.swipeOn = function(autohide) {
exports.hideTimeout = setTimeout(function() {
anim(-4);
}, exports.autohide);
}
};
if (ud>0 && offset<0) anim(4, cb);
if (ud<0 && offset>-24) anim(-4);
};
Bangle.on("swipe", exports.swipeHandler);
Bangle.drawWidgets();