@@ -90,6 +90,7 @@ export class IntegrationService implements Disposable {
9090 private async syncCloudIntegrations ( forceConnect : boolean ) {
9191 const connectedIntegrations = new Set < IntegrationId > ( ) ;
9292 const loggedIn = await this . container . subscription . getAuthenticationSession ( ) ;
93+ const domains = new Map < string , string > ( ) ;
9394 if ( loggedIn ) {
9495 const cloudIntegrations = await this . container . cloudIntegrations ;
9596 const connections = await cloudIntegrations ?. getConnections ( ) ;
@@ -100,10 +101,13 @@ export class IntegrationService implements Disposable {
100101 // GKDev includes some integrations like "google" that we don't support
101102 if ( integrationId == null ) return ;
102103 connectedIntegrations . add ( toIntegrationId [ p . provider ] ) ;
104+ if ( p . domain != null ) {
105+ domains . set ( integrationId , p . domain ) ;
106+ }
103107 } ) ;
104108 }
105109
106- for await ( const integration of this . getSupportedCloudIntegrations ( ) ) {
110+ for await ( const integration of this . getSupportedCloudIntegrations ( domains ) ) {
107111 await integration . syncCloudConnection (
108112 connectedIntegrations . has ( integration . id ) ? 'connected' : 'disconnected' ,
109113 forceConnect ,
@@ -121,9 +125,9 @@ export class IntegrationService implements Disposable {
121125 return connectedIntegrations ;
122126 }
123127
124- private async * getSupportedCloudIntegrations ( ) {
128+ private async * getSupportedCloudIntegrations ( domains : Map < string , string > ) : AsyncIterable < Integration > {
125129 for ( const id of getSupportedCloudIntegrationIds ( ) ) {
126- yield this . get ( id ) ;
130+ yield this . get ( id , domains ?. get ( id ) ) ;
127131 }
128132 }
129133
@@ -437,6 +441,7 @@ export class IntegrationService implements Disposable {
437441 await import ( /* webpackChunkName: "integrations" */ './providers/github' )
438442 ) . GitHubIntegration ( this . container , this . authenticationService , this . getProvidersApi . bind ( this ) ) ;
439443 break ;
444+ case SelfHostedIntegrationId . CloudGitHubEnterprise :
440445 case SelfHostedIntegrationId . GitHubEnterprise :
441446 if ( domain == null ) throw new Error ( `Domain is required for '${ id } ' integration` ) ;
442447 integration = new (
@@ -446,6 +451,7 @@ export class IntegrationService implements Disposable {
446451 this . authenticationService ,
447452 this . getProvidersApi . bind ( this ) ,
448453 domain ,
454+ id ,
449455 ) ;
450456 break ;
451457 case HostingIntegrationId . GitLab :
0 commit comments