File tree Expand file tree Collapse file tree 4 files changed +12
-6
lines changed
arduino-ide-extension/src Expand file tree Collapse file tree 4 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -282,7 +282,7 @@ export class ArduinoFrontendContribution
282282 this . updaterService . init (
283283 this . arduinoPreferences . get ( 'arduino.ide.updateChannel' )
284284 ) ;
285- this . updater . checkForUpdates ( ) . then ( async ( updateInfo ) => {
285+ this . updater . checkForUpdates ( true ) . then ( async ( updateInfo ) => {
286286 if ( ! updateInfo ) return ;
287287 const versionToSkip = await this . localStorageService . getData < string > (
288288 SKIP_IDE_VERSION
Original file line number Diff line number Diff line change @@ -31,8 +31,8 @@ export class IDEUpdaterCommands implements CommandContribution {
3131 } ) ;
3232 }
3333
34- async checkForUpdates ( ) : Promise < UpdateInfo | void > {
35- return await this . updater . checkForUpdates ( ) ;
34+ async checkForUpdates ( initialCheck ?: boolean ) : Promise < UpdateInfo | void > {
35+ return await this . updater . checkForUpdates ( initialCheck ) ;
3636 }
3737
3838 async downloadUpdate ( ) : Promise < void > {
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ export const IDEUpdaterPath = '/services/ide-updater';
4747export const IDEUpdater = Symbol ( 'IDEUpdater' ) ;
4848export interface IDEUpdater extends JsonRpcServer < IDEUpdaterClient > {
4949 init ( channel : UpdateChannel ) : void ;
50- checkForUpdates ( ) : Promise < UpdateInfo | void > ;
50+ checkForUpdates ( initialCheck ?: boolean ) : Promise < UpdateInfo | void > ;
5151 downloadUpdate ( ) : Promise < void > ;
5252 quitAndInstall ( ) : void ;
5353 stopDownload ( ) : void ;
Original file line number Diff line number Diff line change @@ -12,12 +12,13 @@ const IDE_DOWNLOAD_BASE_URL = 'https://downloads.arduino.cc/arduino-ide';
1212
1313@injectable ( )
1414export class IDEUpdaterImpl implements IDEUpdater {
15+ private isAlreadyChecked = false ;
1516 private updater = autoUpdater ;
1617 private cancellationToken ?: CancellationToken ;
1718 protected theiaFEClient ?: IDEUpdaterClient ;
1819 protected clients : Array < IDEUpdaterClient > = [ ] ;
1920
20- init ( channel : UpdateChannel ) {
21+ init ( channel : UpdateChannel ) : void {
2122 this . updater . channel = channel ;
2223 this . updater . setFeedURL ( {
2324 provider : 'generic' ,
@@ -51,7 +52,12 @@ export class IDEUpdaterImpl implements IDEUpdater {
5152 if ( client ) this . clients . push ( client ) ;
5253 }
5354
54- async checkForUpdates ( ) : Promise < UpdateInfo | void > {
55+ async checkForUpdates ( initialCheck ?: boolean ) : Promise < UpdateInfo | void > {
56+ if ( initialCheck ) {
57+ if ( this . isAlreadyChecked ) return Promise . resolve ( ) ;
58+ this . isAlreadyChecked = true ;
59+ }
60+
5561 const {
5662 updateInfo,
5763 cancellationToken,
You can’t perform that action at this time.
0 commit comments