You have your BANGLEJS2 constant defined in the big scope for cleanup and the handler is run in the global context. The variable does not exist there and is undefined so the check never triggers. To solve that either move the declaration out of the block and later delete global.BANGLEJS2 in the remove method or access process.env.HWVERSION for every check instead of storing the result in a constant. Same applies to stuff running in timeouts and intervals.
For the "has no widgets" message, maybe you need to update the clockHasWidgets value stored in the settings file? It was possibly set at a time where your clock did not yet have loadWidgets. You can update that by just setting the clock again in the settings app.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
You have your
BANGLEJS2
constant defined in the big scope for cleanup and the handler is run in the global context. The variable does not exist there and isundefined
so the check never triggers. To solve that either move the declaration out of the block and laterdelete global.BANGLEJS2
in the remove method or accessprocess.env.HWVERSION
for every check instead of storing the result in a constant. Same applies to stuff running in timeouts and intervals.For the "has no widgets" message, maybe you need to update the
clockHasWidgets
value stored in the settings file? It was possibly set at a time where your clock did not yet haveloadWidgets
. You can update that by just setting the clock again in the settings app.