Skip to content

Commit

Permalink
Merge pull request #3491 from thyttan/setui-proposal-preview
Browse files Browse the repository at this point in the history
setuichange: fix push to undefined btnWatches array

as per https://forum.espruino.com/comments/17443678/
  • Loading branch information
thyttan authored Jul 4, 2024
2 parents 0598ed6 + ff937c2 commit a08436b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions apps/setuichange/ChangeLog
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
0.01: New App!
0.02: Fix case where we tried to push to Bangle.btnWatches but it wasn't
defined.
1 change: 1 addition & 0 deletions apps/setuichange/boot.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ Bangle.setUI = (function(mode, cb) {
Bangle.swipeHandler = options.swipe;
Bangle.on("swipe", Bangle.swipeHandler);
}
if ((options.btn || options.btnRelease) && !Bangle.btnWatches) Bangle.btnWatches = [];
if (options.btn) Bangle.btnWatches.push(setWatch(options.btn.bind(options), BTN1, {repeat:1,edge:"rising"}))
if (options.btnRelease) Bangle.btnWatches.push(setWatch(options.btnRelease.bind(options), BTN1, {repeat:1,edge:"falling"}))
if (options.remove) // handler for removing the UI (intervals/etc)
Expand Down
2 changes: 1 addition & 1 deletion apps/setuichange/metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{ "id": "setuichange",
"name": "SetUI Proposals preview",
"version":"0.01",
"version":"0.02",
"description": "Try out potential future changes to `Bangle.setUI`. Makes hardware button interaction snappier. Makes it possible to set custom event handlers on any type/mode, not just `\"custom\"`. Please provide feedback - see `Read more...` below.",
"icon": "app.png",
"tags": "",
Expand Down

0 comments on commit a08436b

Please sign in to comment.