@@ -69,6 +69,7 @@ import { ArduinoPreferences } from './arduino-preferences';
69
69
import { SketchesServiceClientImpl } from '../common/protocol/sketches-service-client-impl' ;
70
70
import { SaveAsSketch } from './contributions/save-as-sketch' ;
71
71
import { SketchbookWidgetContribution } from './widgets/sketchbook/sketchbook-widget-contribution' ;
72
+ import { IDEUpdaterCommands } from './ide-updater/ide-updater-commands' ;
72
73
73
74
const INIT_LIBS_AND_PACKAGES = 'initializedLibsAndPackages' ;
74
75
@@ -158,6 +159,9 @@ export class ArduinoFrontendContribution
158
159
@inject ( LocalStorageService )
159
160
protected readonly localStorageService : LocalStorageService ;
160
161
162
+ @inject ( IDEUpdaterCommands )
163
+ protected readonly updater : IDEUpdaterCommands ;
164
+
161
165
protected invalidConfigPopup :
162
166
| Promise < void | 'No' | 'Yes' | undefined >
163
167
| undefined ;
@@ -267,6 +271,22 @@ export class ArduinoFrontendContribution
267
271
viewContribution . initializeLayout ( app ) ;
268
272
}
269
273
}
274
+
275
+ this . updater . checkForUpdates ( ) . then ( ( updateInfo ) => {
276
+ if ( ! updateInfo ) return ;
277
+ this . messageService
278
+ . info (
279
+ `new version available: ${ updateInfo . version } ` ,
280
+ 'ok install it' ,
281
+ 'nope, thanks'
282
+ )
283
+ . then ( ( result ) => {
284
+ if ( result === 'ok install it' ) {
285
+ this . updater . downloadUpdate ( ) ;
286
+ }
287
+ } ) ;
288
+ } ) ;
289
+
270
290
const start = async ( { selectedBoard } : BoardsConfig . Config ) => {
271
291
if ( selectedBoard ) {
272
292
const { name, fqbn } = selectedBoard ;
0 commit comments