Bangle.js 2: Event handler not reset #5855
Unanswered
espruino-discuss2
asked this question in
Bangle.js
Replies: 1 comment
-
Posted at 2023-04-29 by neshanjo Just realized that I can recreate the issue in the web IDE with the same code, see attachment. Posted at 2023-05-02 by @gfwilliams The issue is you've defined a function called So when it goes to reset the watch, that gets called and it doesn't actually get reset! If you just rename the Posted at 2023-05-02 by neshanjo Aaargh! 🤦 Thanks! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2023-04-29 by neshanjo
Hi,
I'm using
espruino -d Bangle.js -w index.js
to connect to my Bangle.js in watch mode. Everytime I change the file in my local IDE, it is re-uploaded and re-executed like expected.I've noticed that sometimes after I changed the file and it gets uploaded, the console shows
while sometimes only
is shown, especially when I'm working on a larger file.
In the latter case, however, the state on the watch is not reset correctly and event handlers are added up. For example, this code
makes the log message appear multiple times after multiple file uploads.
When I long-press the button and then trigger a re-upload, the state is reset correctly.
Is there anything I can do to re-initialize the event handlers before each re-upload in watch mode?
Unfortunately, the small code example above does not reproduce the problem. It only happens with some larger code file.
Kind regards,
Johannes
Beta Was this translation helpful? Give feedback.
All reactions