Skip to content

Commit 9323160

Browse files
auto-select for unplug-plug: same board diff. port
1 parent 3f1609f commit 9323160

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

arduino-ide-extension/src/browser/boards/boards-service-provider.ts

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -370,13 +370,24 @@ export class BoardsServiceProvider
370370
({ state }) => state !== AvailableBoard.State.incomplete
371371
)) {
372372
if (
373-
(Board.hardwareIdEquals(
373+
Board.hardwareIdEquals(
374374
this.latestValidBoardsConfig.selectedBoard,
375375
board
376-
) ||
377-
(this.latestValidBoardsConfig.selectedBoard.fqbn === board.fqbn &&
378-
this.latestValidBoardsConfig.selectedBoard.name ===
379-
board.name)) &&
376+
)
377+
) {
378+
this.boardsConfig = {
379+
selectedBoard: {
380+
...this.latestValidBoardsConfig.selectedBoard,
381+
port: board.port,
382+
},
383+
selectedPort: board.port,
384+
};
385+
return true;
386+
}
387+
388+
if (
389+
this.latestValidBoardsConfig.selectedBoard.fqbn === board.fqbn &&
390+
this.latestValidBoardsConfig.selectedBoard.name === board.name &&
380391
Port.sameAs(this.latestValidBoardsConfig.selectedPort, board.port)
381392
) {
382393
this.boardsConfig = this.latestValidBoardsConfig;

0 commit comments

Comments
 (0)