File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
arduino-ide-extension/src/browser/contributions Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 77} from '../../common/protocol' ;
88import { Contribution } from './contribution' ;
99
10+ const Arduino_BuiltIn = 'Arduino_BuiltIn' ;
11+
1012@injectable ( )
1113export class FirstStartupInstaller extends Contribution {
1214 @inject ( LocalStorageService )
@@ -25,8 +27,8 @@ export class FirstStartupInstaller extends Contribution {
2527 id : 'arduino:avr' ,
2628 } ) ;
2729 const builtInLibrary = (
28- await this . libraryService . search ( { query : ' Arduino_BuiltIn' } )
29- ) [ 0 ] ;
30+ await this . libraryService . search ( { query : Arduino_BuiltIn } )
31+ ) . find ( ( { name } ) => name === Arduino_BuiltIn ) ; // Filter by `name` to ensure "exact match". See: https://github.com/arduino/arduino-ide/issues/1526.
3032
3133 let avrPackageError : Error | undefined ;
3234 let builtInLibraryError : Error | undefined ;
@@ -84,7 +86,7 @@ export class FirstStartupInstaller extends Contribution {
8486 }
8587 if ( builtInLibraryError ) {
8688 this . messageService . error (
87- `Could not install ${ builtInLibrary . name } library: ${ builtInLibraryError } `
89+ `Could not install ${ Arduino_BuiltIn } library: ${ builtInLibraryError } `
8890 ) ;
8991 }
9092
You can’t perform that action at this time.
0 commit comments