File tree 1 file changed +12
-8
lines changed
arduino-ide-extension/src/common/protocol
1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -522,7 +522,13 @@ export namespace Board {
522
522
const counter = distinctBoardNames . get ( name ) || 0 ;
523
523
distinctBoardNames . set ( name , counter + 1 ) ;
524
524
}
525
-
525
+ let selectedBoardPackageId : string | undefined = undefined ;
526
+ if ( selectedBoard ?. fqbn ) {
527
+ selectedBoardPackageId = selectedBoard . fqbn
528
+ . split ( ':' )
529
+ . slice ( 0 , 2 )
530
+ . join ( ':' ) ;
531
+ }
526
532
// Due to the non-unique board names, we have to check the package name as well.
527
533
const selected = ( board : BoardWithPackage ) => {
528
534
if ( ! ! selectedBoard ) {
@@ -532,15 +538,13 @@ export namespace Board {
532
538
selectedBoard
533
539
)
534
540
) {
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 ;
539
543
}
540
- if ( 'packageId' in selectedBoard ) {
541
- return board . packageId === ( selectedBoard as any ) . packageId ;
544
+ if ( ! board . fqbn && board . name === selectedBoard . name ) {
545
+ return true ;
542
546
}
543
- return true ;
547
+ return false ;
544
548
}
545
549
}
546
550
return false ;
You can’t perform that action at this time.
0 commit comments