diff --git a/src/eventListeners.js b/src/eventListeners.js index a7ca9a5..9667a0d 100644 --- a/src/eventListeners.js +++ b/src/eventListeners.js @@ -34,6 +34,7 @@ export function setupEventListeners() { } else { console.log("Disconnecting from port...") globals.setPortConnected(false); + globals.reader.cancel(); onPortDisconnect(); } }); diff --git a/src/globals.js b/src/globals.js index f2c686d..3075afc 100644 --- a/src/globals.js +++ b/src/globals.js @@ -64,8 +64,10 @@ export function setWriter(newWriter) { // expose some globals for debuggin in webconsole if (typeof window !== 'undefined') { window.wsc = { - isPortConnected, - autoscroll, - serialPorts, + get isPortConnected() { return isPortConnected; }, + get autoscroll() { return autoscroll; }, + get serialPorts() { return serialPorts; }, + get reader() { return reader; }, + get writer() { return writer; } }; } \ No newline at end of file