@@ -194,26 +194,13 @@ export class HomeWebviewProvider implements WebviewProvider<State, State, HomeWe
194194 }
195195
196196 this . _discovering = this . container . git . isDiscoveringRepositories ;
197+ void this . _discovering . finally ( ( ) => ( this . _discovering = undefined ) ) ;
197198 this . _etag = await this . _discovering ;
198- this . _discovering = undefined ;
199199 this . notifyDidCompleteDiscoveringRepositories ( ) ;
200200 }
201201
202202 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 ( ) ;
217204 }
218205
219206 private async onChooseRepository ( ) {
@@ -237,10 +224,9 @@ export class HomeWebviewProvider implements WebviewProvider<State, State, HomeWe
237224 this . selectRepository ( pick . path ) ;
238225 }
239226
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+
244230 this . notifyDidChangeRepositories ( ) ;
245231 }
246232
@@ -394,7 +380,10 @@ export class HomeWebviewProvider implements WebviewProvider<State, State, HomeWe
394380 }
395381
396382 this . resumeRepositorySubscription ( ) ;
397- this . notifyDidChangeRepositories ( true ) ;
383+
384+ if ( this . _discovering == null && this . _etag !== this . container . git . etag ) {
385+ this . notifyDidChangeRepositories ( true ) ;
386+ }
398387 }
399388
400389 private openInGraph ( params : OpenInGraphParams ) {
@@ -903,6 +892,8 @@ export class HomeWebviewProvider implements WebviewProvider<State, State, HomeWe
903892 }
904893 private _notifyDidChangeRepositoriesDebounced : Deferrable < ( ) => void > | undefined = undefined ;
905894 private notifyDidChangeRepositories ( immediate = false ) {
895+ if ( this . _discovering != null ) return ;
896+
906897 if ( immediate ) {
907898 this . notifyDidChangeRepositoriesCore ( ) ;
908899 return ;
@@ -934,7 +925,7 @@ export class HomeWebviewProvider implements WebviewProvider<State, State, HomeWe
934925 void this . host . notify ( DidChangeLaunchpad , undefined ) ;
935926 }
936927
937- private async notifyDidChangeOnboardingIntegration ( ) {
928+ private async notifyDidChangeIntegrations ( ) {
938929 // force rechecking
939930 const integrations = await this . getIntegrationStates ( true ) ;
940931 const anyConnected = integrations . some ( i => i . connected ) ;
0 commit comments