I now changed it to
Bangle.setUI({ mode : "custom",clock:true, remove : function() { // Called to unload all of the clock app if (typeof PosInterval === "undefined") { console.log("PosInterval is undefined") } else { if (PosInterval) clearInterval(PosInterval); } PosInterval = undefined; if (drawTimeoutSeconds) clearTimeout(drawTimeoutSeconds); drawTimeoutSeconds = undefined; if (drawTimeout) clearTimeout(drawTimeout); drawTimeout = undefined; if (typeof onDrag !== "undefined") Bangle.removeListener('drag',onDrag); if (typeof onLock !== "undefined") Bangle.removeListener('onLock',onLock); }});
Now, the loader shows up, but the Listener seems to be still in place.
There shouldn't be quotation marks around undefined.
undefined
Try: if (typeof onDrag !== undefined) Bangle.removeListener('drag',onDrag);
if (typeof onDrag !== undefined) Bangle.removeListener('drag',onDrag);
@Hank started
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.
I now changed it to
Now, the loader shows up, but the Listener seems to be still in place.