File tree 1 file changed +14
-0
lines changed
arduino-ide-extension/src/browser
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import {
11
11
ContextMenuRenderer ,
12
12
FrontendApplication ,
13
13
FrontendApplicationContribution ,
14
+ LocalStorageService ,
14
15
OpenerService ,
15
16
StatusBar ,
16
17
StatusBarAlignment ,
@@ -199,13 +200,26 @@ export class ArduinoFrontendContribution
199
200
@inject ( FrontendApplicationStateService )
200
201
protected readonly appStateService : FrontendApplicationStateService ;
201
202
203
+ @inject ( LocalStorageService )
204
+ protected readonly localStorageService : LocalStorageService ;
205
+
202
206
protected invalidConfigPopup :
203
207
| Promise < void | 'No' | 'Yes' | undefined >
204
208
| undefined ;
205
209
protected toDisposeOnStop = new DisposableCollection ( ) ;
206
210
207
211
@postConstruct ( )
208
212
protected async init ( ) : Promise < void > {
213
+ const notFirstStartup = await this . localStorageService . getData (
214
+ 'notFirstStartup'
215
+ ) ;
216
+ if ( ! notFirstStartup ) {
217
+ await this . localStorageService . setData ( 'notFirstStartup' , true ) ;
218
+ const avrPackage = await this . boardsService . getBoardPackage ( {
219
+ id : 'arduino:avr' ,
220
+ } ) ;
221
+ avrPackage && ( await this . boardsService . install ( { item : avrPackage } ) ) ;
222
+ }
209
223
if ( ! window . navigator . onLine ) {
210
224
// tslint:disable-next-line:max-line-length
211
225
this . messageService . warn (
You can’t perform that action at this time.
0 commit comments