File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
arduino-ide-extension/src/browser/boards Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -30,11 +30,11 @@ export class BoardsServiceClientImpl implements BoardsServiceClient {
30
30
31
31
notifyAttachedBoardsChanged ( event : AttachedBoardsChangeEvent ) : void {
32
32
this . logger . info ( 'Attached boards changed: ' , JSON . stringify ( event ) ) ;
33
- const { boards } = event . newState ;
33
+ const detachedBoards = AttachedBoardsChangeEvent . diff ( event ) . detached . filter ( AttachedSerialBoard . is ) . map ( ( { port } ) => port ) ;
34
34
const { selectedPort, selectedBoard } = this . boardsConfig ;
35
35
this . onAttachedBoardsChangedEmitter . fire ( event ) ;
36
- // Dynamically unset the port if there is not corresponding attached boards for it.
37
- if ( ! ! selectedPort && boards . filter ( AttachedSerialBoard . is ) . map ( ( { port } ) => port ) . indexOf ( selectedPort ) === - 1 ) {
36
+ // Dynamically unset the port if the selected board was an attached one and we detached it.
37
+ if ( ! ! selectedPort && detachedBoards . indexOf ( selectedPort ) === - 1 ) {
38
38
this . boardsConfig = {
39
39
selectedBoard,
40
40
selectedPort : undefined
You can’t perform that action at this time.
0 commit comments