File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed
Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -312,6 +312,7 @@ class MicrobitWebUSBConnectionImpl
312312 await this . disconnect ( ) ;
313313 this . visibilityReconnect = true ;
314314 } else {
315+ if ( this . addedListeners . serialdata ) {
315316 this . log ( "Reinstating serial after flash" ) ;
316317 if ( this . connection . daplink ) {
317318 await this . connection . daplink . connect ( ) ;
@@ -483,6 +484,7 @@ class MicrobitWebUSBConnectionImpl
483484 case "serialdata" : {
484485 if ( ! this . flashing ) {
485486 this . startSerialInternal ( ) ;
487+ this . addedListeners . serialdata = 1 ;
486488 }
487489 break ;
488490 }
@@ -493,6 +495,7 @@ class MicrobitWebUSBConnectionImpl
493495 switch ( type as keyof SerialConnectionEventMap ) {
494496 case "serialdata" : {
495497 this . stopSerialInternal ( ) ;
498+ this . addedListeners . serialdata = 0 ;
496499 break ;
497500 }
498501 }
You can’t perform that action at this time.
0 commit comments