@@ -168,23 +168,23 @@ export class ExtensionController {
168
168
}
169
169
}
170
170
171
- refresh ( ) {
171
+ async refresh ( ) {
172
172
if ( this . indicator === null || this . indicator === undefined ) {
173
173
return
174
174
}
175
175
176
176
this . indicator . initMenu ( )
177
177
178
178
try {
179
- this . _checkErrors ( )
180
- this . _fetchStatus ( )
181
- this . _fetchData ( )
179
+ await this . _checkErrors ( )
180
+ await this . _fetchStatus ( )
181
+ await this . _fetchData ( )
182
182
} catch ( error ) {
183
183
logError ( error )
184
184
}
185
185
}
186
186
187
- startRefreshing ( ) {
187
+ async startRefreshing ( ) {
188
188
if ( this . isStarted === true ) {
189
189
return
190
190
}
@@ -194,11 +194,13 @@ export class ExtensionController {
194
194
this . observeSettings ( this . settingsRepository )
195
195
196
196
try {
197
- const settingsRepository = this . settingsRepository
198
- this . refresh ( )
197
+ await new Promise ( ( resolve ) => setTimeout ( resolve , 2000 ) )
198
+ await this . refresh ( )
199
+ await new Promise ( ( resolve ) => setTimeout ( resolve , 5000 ) )
199
200
201
+ const settingsRepository = this . settingsRepository
200
202
this . stateRefreshInterval = setInterval ( ( ) => this . _checkErrors ( ) , 1 * 1000 )
201
- this . githubActionsRefreshInterval = setInterval ( ( ) => this . _fetchStatus ( ) , settingsRepository . fetchRefreshTime ( ) * 1000 )
203
+ this . statusRefreshInterval = setInterval ( ( ) => this . _fetchStatus ( ) , settingsRepository . fetchRefreshTime ( ) * 1000 )
202
204
this . dataRefreshInterval = setInterval ( ( ) => this . _fetchData ( ) , settingsRepository . fetchRefreshFullUpdateTime ( ) * 60 * 1000 )
203
205
} catch ( error ) {
204
206
logError ( error )
@@ -217,8 +219,8 @@ export class ExtensionController {
217
219
clearInterval ( this . stateRefreshInterval )
218
220
this . stateRefreshInterval = null
219
221
220
- clearInterval ( this . githubActionsRefreshInterval )
221
- this . githubActionsRefreshInterval = null
222
+ clearInterval ( this . statusRefreshInterval )
223
+ this . statusRefreshInterval = null
222
224
223
225
clearInterval ( this . dataRefreshInterval )
224
226
this . dataRefreshInterval = null
@@ -408,7 +410,7 @@ export class ExtensionController {
408
410
}
409
411
}
410
412
411
- _checkErrors ( ) {
413
+ async _checkErrors ( ) {
412
414
if ( this . indicator == undefined ) {
413
415
return
414
416
}
@@ -422,7 +424,7 @@ export class ExtensionController {
422
424
return
423
425
}
424
426
425
- this . extensionRepository . checkErrors ( {
427
+ await this . extensionRepository . checkErrors ( {
426
428
onNotInstalledCli : ( ) => {
427
429
this . indicator . setState ( { state : ExtensionState . NOT_INSTALLED_CLI , forceUpdate : true } )
428
430
} ,
@@ -439,7 +441,7 @@ export class ExtensionController {
439
441
} )
440
442
}
441
443
442
- _fetchStatus ( ) {
444
+ async _fetchStatus ( ) {
443
445
if ( this . indicator == undefined ) {
444
446
return
445
447
}
@@ -454,7 +456,7 @@ export class ExtensionController {
454
456
455
457
const { owner, repo } = this . settingsRepository . ownerAndRepo ( )
456
458
457
- this . extensionRepository . fetchStatus ( {
459
+ await this . extensionRepository . fetchStatus ( {
458
460
owner,
459
461
repo,
460
462
onNoInternet : ( ) => {
@@ -518,7 +520,7 @@ export class ExtensionController {
518
520
this . indicator . initMenu ( )
519
521
}
520
522
521
- this . extensionRepository . fetchData ( {
523
+ await this . extensionRepository . fetchData ( {
522
524
type,
523
525
settingsRepository : this . settingsRepository ,
524
526
onUserDownloaded : ( userObject ) => {
0 commit comments