File tree 4 files changed +12
-6
lines changed
arduino-ide-extension/src
4 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -282,7 +282,7 @@ export class ArduinoFrontendContribution
282
282
this . updaterService . init (
283
283
this . arduinoPreferences . get ( 'arduino.ide.updateChannel' )
284
284
) ;
285
- this . updater . checkForUpdates ( ) . then ( async ( updateInfo ) => {
285
+ this . updater . checkForUpdates ( true ) . then ( async ( updateInfo ) => {
286
286
if ( ! updateInfo ) return ;
287
287
const versionToSkip = await this . localStorageService . getData < string > (
288
288
SKIP_IDE_VERSION
Original file line number Diff line number Diff line change @@ -31,8 +31,8 @@ export class IDEUpdaterCommands implements CommandContribution {
31
31
} ) ;
32
32
}
33
33
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 ) ;
36
36
}
37
37
38
38
async downloadUpdate ( ) : Promise < void > {
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ export const IDEUpdaterPath = '/services/ide-updater';
47
47
export const IDEUpdater = Symbol ( 'IDEUpdater' ) ;
48
48
export interface IDEUpdater extends JsonRpcServer < IDEUpdaterClient > {
49
49
init ( channel : UpdateChannel ) : void ;
50
- checkForUpdates ( ) : Promise < UpdateInfo | void > ;
50
+ checkForUpdates ( initialCheck ?: boolean ) : Promise < UpdateInfo | void > ;
51
51
downloadUpdate ( ) : Promise < void > ;
52
52
quitAndInstall ( ) : void ;
53
53
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';
12
12
13
13
@injectable ( )
14
14
export class IDEUpdaterImpl implements IDEUpdater {
15
+ private isAlreadyChecked = false ;
15
16
private updater = autoUpdater ;
16
17
private cancellationToken ?: CancellationToken ;
17
18
protected theiaFEClient ?: IDEUpdaterClient ;
18
19
protected clients : Array < IDEUpdaterClient > = [ ] ;
19
20
20
- init ( channel : UpdateChannel ) {
21
+ init ( channel : UpdateChannel ) : void {
21
22
this . updater . channel = channel ;
22
23
this . updater . setFeedURL ( {
23
24
provider : 'generic' ,
@@ -51,7 +52,12 @@ export class IDEUpdaterImpl implements IDEUpdater {
51
52
if ( client ) this . clients . push ( client ) ;
52
53
}
53
54
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
+
55
61
const {
56
62
updateInfo,
57
63
cancellationToken,
You can’t perform that action at this time.
0 commit comments