File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed
arduino-ide-extension/src/common/protocol Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff 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 ;
You can’t perform that action at this time.
0 commit comments