@@ -194,26 +194,13 @@ export class HomeWebviewProvider implements WebviewProvider<State, State, HomeWe
194
194
}
195
195
196
196
this . _discovering = this . container . git . isDiscoveringRepositories ;
197
+ void this . _discovering . finally ( ( ) => ( this . _discovering = undefined ) ) ;
197
198
this . _etag = await this . _discovering ;
198
- this . _discovering = undefined ;
199
199
this . notifyDidCompleteDiscoveringRepositories ( ) ;
200
200
}
201
201
202
202
private onChangeConnectionState ( ) {
203
- void this . notifyDidChangeOnboardingIntegration ( ) ;
204
- }
205
-
206
- private async shouldNotifyRepositoryChange ( ) : Promise < boolean > {
207
- if ( this . _etag === this . container . git . etag ) {
208
- return false ;
209
- }
210
-
211
- if ( this . _discovering != null ) {
212
- this . _etag = await this . _discovering ;
213
- if ( this . _etag === this . container . git . etag ) return false ;
214
- }
215
-
216
- return true ;
203
+ void this . notifyDidChangeIntegrations ( ) ;
217
204
}
218
205
219
206
private async onChooseRepository ( ) {
@@ -237,10 +224,9 @@ export class HomeWebviewProvider implements WebviewProvider<State, State, HomeWe
237
224
this . selectRepository ( pick . path ) ;
238
225
}
239
226
240
- private async onRepositoriesChanged ( ) {
241
- if ( ! ( await this . shouldNotifyRepositoryChange ( ) ) ) {
242
- return ;
243
- }
227
+ private onRepositoriesChanged ( ) {
228
+ if ( this . _discovering != null || this . _etag === this . container . git . etag ) return ;
229
+
244
230
this . notifyDidChangeRepositories ( ) ;
245
231
}
246
232
@@ -394,7 +380,10 @@ export class HomeWebviewProvider implements WebviewProvider<State, State, HomeWe
394
380
}
395
381
396
382
this . resumeRepositorySubscription ( ) ;
397
- this . notifyDidChangeRepositories ( true ) ;
383
+
384
+ if ( this . _discovering == null && this . _etag !== this . container . git . etag ) {
385
+ this . notifyDidChangeRepositories ( true ) ;
386
+ }
398
387
}
399
388
400
389
private openInGraph ( params : OpenInGraphParams ) {
@@ -903,6 +892,8 @@ export class HomeWebviewProvider implements WebviewProvider<State, State, HomeWe
903
892
}
904
893
private _notifyDidChangeRepositoriesDebounced : Deferrable < ( ) => void > | undefined = undefined ;
905
894
private notifyDidChangeRepositories ( immediate = false ) {
895
+ if ( this . _discovering != null ) return ;
896
+
906
897
if ( immediate ) {
907
898
this . notifyDidChangeRepositoriesCore ( ) ;
908
899
return ;
@@ -934,7 +925,7 @@ export class HomeWebviewProvider implements WebviewProvider<State, State, HomeWe
934
925
void this . host . notify ( DidChangeLaunchpad , undefined ) ;
935
926
}
936
927
937
- private async notifyDidChangeOnboardingIntegration ( ) {
928
+ private async notifyDidChangeIntegrations ( ) {
938
929
// force rechecking
939
930
const integrations = await this . getIntegrationStates ( true ) ;
940
931
const anyConnected = integrations . some ( i => i . connected ) ;
0 commit comments