[ fixup ] Clear timeout after removing listeners for safety
parent
8b9bccdd10
commit
4c1bcbbb4d
|
|
@ -6,4 +6,4 @@
|
||||||
add settings for widgets, order of drawing and hour hand length
|
add settings for widgets, order of drawing and hour hand length
|
||||||
0.06: Fix issue showing widgets when app is fast-loaded into from launcher with widgets disabled
|
0.06: Fix issue showing widgets when app is fast-loaded into from launcher with widgets disabled
|
||||||
0.07: Enable fast loading and queue updates to the second
|
0.07: Enable fast loading and queue updates to the second
|
||||||
0.08: Restore redraw on charging event
|
0.08: Restore redraw on charging event + fixup for safer fast-loading
|
||||||
|
|
|
||||||
|
|
@ -135,11 +135,12 @@ let drawScale = function() {
|
||||||
Bangle.setUI({
|
Bangle.setUI({
|
||||||
mode: "clock",
|
mode: "clock",
|
||||||
remove: function() {
|
remove: function() {
|
||||||
if (drawTimeout) clearTimeout(drawTimeout);
|
|
||||||
drawTimeout = undefined;
|
|
||||||
Bangle.removeListener('lcdPower', updateState);
|
Bangle.removeListener('lcdPower', updateState);
|
||||||
Bangle.removeListener('lock', updateState);
|
Bangle.removeListener('lock', updateState);
|
||||||
Bangle.removeListener('charging', draw);
|
Bangle.removeListener('charging', draw);
|
||||||
|
// We clear drawTimout after removing all listeners, because they can add one again
|
||||||
|
if (drawTimeout) clearTimeout(drawTimeout);
|
||||||
|
drawTimeout = undefined;
|
||||||
require("widget_utils").show();
|
require("widget_utils").show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue