Skip to content

Commit 0b0ce7b

Browse files
addressLabel if possible, reconcileAvailableBoards
1 parent a6a7af4 commit 0b0ce7b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,18 +578,23 @@ export class BoardsServiceProvider implements FrontendApplicationContribution {
578578
boardsConfig.selectedBoard &&
579579
availableBoards.every(({ selected }) => !selected)
580580
) {
581+
let port = boardsConfig.selectedPort
581582
// If the selected board has the same port of an unknown board
582583
// that is already in availableBoards we might get a duplicate port.
583584
// So we remove the one already in the array and add the selected one.
584585
const found = availableBoards.findIndex(
585586
(board) => board.port?.address === boardsConfig.selectedPort?.address
586587
);
587588
if (found >= 0) {
589+
// get the "Unknown board port" that we will substitute,
590+
// then we can include it in the "availableBoard object"
591+
// pushed below; to ensure addressLabel is included
592+
port = availableBoards[found].port
588593
availableBoards.splice(found, 1);
589594
}
590595
availableBoards.push({
591596
...boardsConfig.selectedBoard,
592-
port: boardsConfig.selectedPort,
597+
port,
593598
selected: true,
594599
state: AvailableBoard.State.incomplete,
595600
});

0 commit comments

Comments
 (0)