@@ -19,6 +19,7 @@ import { CommandRegistry } from '@theia/core/lib/common/command';
19
19
import { certificateList , sanifyCertString } from './utils' ;
20
20
import { ArduinoFirmwareUploader } from '../../../common/protocol/arduino-firmware-uploader' ;
21
21
import { nls } from '@theia/core/lib/common' ;
22
+ import { FrontendApplicationStateService } from '@theia/core/lib/browser/frontend-application-state' ;
22
23
23
24
@injectable ( )
24
25
export class UploadCertificateDialogWidget extends ReactWidget {
@@ -37,6 +38,9 @@ export class UploadCertificateDialogWidget extends ReactWidget {
37
38
@inject ( ArduinoFirmwareUploader )
38
39
protected readonly arduinoFirmwareUploader : ArduinoFirmwareUploader ;
39
40
41
+ @inject ( FrontendApplicationStateService )
42
+ private readonly appStateService : FrontendApplicationStateService ;
43
+
40
44
protected certificates : string [ ] = [ ] ;
41
45
protected updatableFqbns : string [ ] = [ ] ;
42
46
protected availableBoards : AvailableBoard [ ] = [ ] ;
@@ -66,10 +70,12 @@ export class UploadCertificateDialogWidget extends ReactWidget {
66
70
}
67
71
} ) ;
68
72
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
+ ) ;
73
79
74
80
this . boardsServiceClient . onAvailableBoardsChanged ( ( availableBoards ) => {
75
81
this . availableBoards = availableBoards ;
0 commit comments