Skip to content

Commit a3ecbe0

Browse files
author
thyttan
committed
smpltmr: btn listener backwards compatibility
1 parent 2bcbfa3 commit a3ecbe0

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

apps/smpltmr/app.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,15 @@ function updateLayoutField(layout, field, value) {
173173
Bangle.loadWidgets();
174174
Bangle.drawWidgets();
175175

176-
Bangle.setUI({
176+
let uiOptions = {
177177
mode : "custom",
178178
touch : function(n,e) {onTouch(n,e);},
179179
drag : function(e) {onDrag(e);},
180-
btnRelease : function(n) {onButton();},
181-
});
180+
};
181+
if (parseFloat(process.env.VERSION.replace("v","")) < 224.164) {uiOptions.btn = function(n) {onButton();};}
182+
else {uiOptions.btnRelease = function(n) {onButton();};}
183+
184+
Bangle.setUI(uiOptions);
182185

183186
g.clearRect(Bangle.appRect);
184187
if (timerRunning()) {

0 commit comments

Comments
 (0)