Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 026e80e

Browse files
fix #1383: missing port labels (#1412)
* fallback to port.address if addressLabel is false * addressLabel if possible, reconcileAvailableBoards * remove fallback
1 parent fdf6f0f commit 026e80e

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
@@ -600,18 +600,23 @@ export class BoardsServiceProvider
600600
boardsConfig.selectedBoard &&
601601
availableBoards.every(({ selected }) => !selected)
602602
) {
603+
let port = boardsConfig.selectedPort
603604
// If the selected board has the same port of an unknown board
604605
// that is already in availableBoards we might get a duplicate port.
605606
// So we remove the one already in the array and add the selected one.
606607
const found = availableBoards.findIndex(
607608
(board) => board.port?.address === boardsConfig.selectedPort?.address
608609
);
609610
if (found >= 0) {
611+
// get the "Unknown board port" that we will substitute,
612+
// then we can include it in the "availableBoard object"
613+
// pushed below; to ensure addressLabel is included
614+
port = availableBoards[found].port
610615
availableBoards.splice(found, 1);
611616
}
612617
availableBoards.push({
613618
...boardsConfig.selectedBoard,
614-
port: boardsConfig.selectedPort,
619+
port,
615620
selected: true,
616621
state: AvailableBoard.State.incomplete,
617622
});

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /