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

Appearance settings

Commit 82d3c34

Browse filesBrowse files
author
Akos Kitta
committed
fix(regression): find board match in dialog
when platform is not installed Ref: #2149 (comment) Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
1 parent e9004b0 commit 82d3c34
Copy full SHA for 82d3c34

File tree

1 file changed

+12
-8
lines changed
Filter options

1 file changed

+12
-8
lines changed

‎arduino-ide-extension/src/common/protocol/boards-service.ts

Copy file name to clipboardExpand all lines: arduino-ide-extension/src/common/protocol/boards-service.ts
+12-8Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,13 @@ export namespace Board {
522522
const counter = distinctBoardNames.get(name) || 0;
523523
distinctBoardNames.set(name, counter + 1);
524524
}
525-
525+
let selectedBoardPackageId: string | undefined = undefined;
526+
if (selectedBoard?.fqbn) {
527+
selectedBoardPackageId = selectedBoard.fqbn
528+
.split(':')
529+
.slice(0, 2)
530+
.join(':');
531+
}
526532
// Due to the non-unique board names, we have to check the package name as well.
527533
const selected = (board: BoardWithPackage) => {
528534
if (!!selectedBoard) {
@@ -532,15 +538,13 @@ export namespace Board {
532538
selectedBoard
533539
)
534540
) {
535-
// TODO: this won't work anymore with the current BoardIdentifier as it does not contain the container packager info.
536-
// Possible duplicate items in board select dialog for non-installed boards from different platforms.
537-
if ('packageName' in selectedBoard) {
538-
return board.packageName === (selectedBoard as any).packageName;
541+
if (selectedBoardPackageId) {
542+
return board.packageId === selectedBoardPackageId;
539543
}
540-
if ('packageId' in selectedBoard) {
541-
return board.packageId === (selectedBoard as any).packageId;
544+
if (!board.fqbn && board.name === selectedBoard.name) {
545+
return true;
542546
}
543-
return true;
547+
return false;
544548
}
545549
}
546550
return false;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.