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 {
21
21
this . _partialToken = null ;
22
22
this . _uid = null ;
23
23
this . _readLoopPromise = null ;
24
+ this . _messageCallback = null ;
24
25
this . _btnSelectHostFolderCallback = null ;
25
26
this . _btnUseHostFolderCallback = null ;
26
-
27
27
}
28
28
29
29
async init ( params ) {
@@ -245,8 +245,10 @@ class USBWorkflow extends Workflow {
245
245
246
246
// Workflow specific Functions
247
247
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 ) ;
250
252
251
253
let onDisconnect = async ( e ) => {
252
254
await this . onDisconnected ( e , false ) ;
You can’t perform that action at this time.
0 commit comments