File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -21,9 +21,9 @@ class USBWorkflow extends Workflow {
2121 this . _partialToken = null ;
2222 this . _uid = null ;
2323 this . _readLoopPromise = null ;
24+ this . _messageCallback = null ;
2425 this . _btnSelectHostFolderCallback = null ;
2526 this . _btnUseHostFolderCallback = null ;
26-
2727 }
2828
2929 async init ( params ) {
@@ -245,8 +245,10 @@ class USBWorkflow extends Workflow {
245245
246246 // Workflow specific Functions
247247 async _switchToDevice ( device ) {
248- device . removeEventListener ( "message" , this . onSerialReceive . bind ( this ) ) ;
249- device . addEventListener ( "message" , this . onSerialReceive . bind ( this ) ) ;
248+
249+ device . removeEventListener ( "message" , this . _messageCallback ) ;
250+ this . _messageCallback = this . onSerialReceive . bind ( this ) ;
251+ device . addEventListener ( "message" , this . _messageCallback ) ;
250252
251253 let onDisconnect = async ( e ) => {
252254 await this . onDisconnected ( e , false ) ;
You can’t perform that action at this time.
0 commit comments