@@ -19,6 +19,7 @@ import { CommandRegistry } from '@theia/core/lib/common/command';
1919import { certificateList , sanifyCertString } from './utils' ;
2020import { ArduinoFirmwareUploader } from '../../../common/protocol/arduino-firmware-uploader' ;
2121import { nls } from '@theia/core/lib/common' ;
22+ import { FrontendApplicationStateService } from '@theia/core/lib/browser/frontend-application-state' ;
2223
2324@injectable ( )
2425export class UploadCertificateDialogWidget extends ReactWidget {
@@ -37,6 +38,9 @@ export class UploadCertificateDialogWidget extends ReactWidget {
3738 @inject ( ArduinoFirmwareUploader )
3839 protected readonly arduinoFirmwareUploader : ArduinoFirmwareUploader ;
3940
41+ @inject ( FrontendApplicationStateService )
42+ private readonly appStateService : FrontendApplicationStateService ;
43+ 4044 protected certificates : string [ ] = [ ] ;
4145 protected updatableFqbns : string [ ] = [ ] ;
4246 protected availableBoards : AvailableBoard [ ] = [ ] ;
@@ -66,10 +70,12 @@ export class UploadCertificateDialogWidget extends ReactWidget {
6670 }
6771 } ) ;
6872
69- this . arduinoFirmwareUploader . updatableBoards ( ) . then ( ( fqbns ) => {
70- this . updatableFqbns = fqbns ;
71- this . update ( ) ;
72- } ) ;
73+ this . appStateService . reachedState ( 'ready' ) . then ( ( ) =>
74+ this . arduinoFirmwareUploader . updatableBoards ( ) . then ( ( fqbns ) => {
75+ this . updatableFqbns = fqbns ;
76+ this . update ( ) ;
77+ } )
78+ ) ;
7379
7480 this . boardsServiceClient . onAvailableBoardsChanged ( ( availableBoards ) => {
7581 this . availableBoards = availableBoards ;
0 commit comments