@@ -9,6 +9,7 @@ import * as configcatcommon from 'configcat-common';
9
9
import * as semver from 'semver' ;
10
10
import { ISessionService } from './services/sessionService' ;
11
11
import { ILogService } from './services/logService' ;
12
+ import { IHostService } from './services/hostService' ;
12
13
13
14
const EXPERTIMENTAL_SETTINGS = [
14
15
'gitpod.remote.useLocalApp' ,
@@ -23,11 +24,10 @@ export class ExperimentalSettings {
23
24
key : string ,
24
25
extensionVersion : string ,
25
26
private readonly sessionService : ISessionService ,
26
- private readonly context : vscode . ExtensionContext ,
27
+ private readonly hostService : IHostService ,
27
28
private readonly logger : ILogService
28
29
) {
29
- this . configcatClient = configcat . createClientWithLazyLoad ( key , {
30
- baseUrl : new URL ( '/configcat' , this . context . extensionMode === vscode . ExtensionMode . Production ? 'https://gitpod.io' : 'https://gitpod-staging.com' ) . href ,
30
+ const configCatOptions = {
31
31
logger : {
32
32
debug ( ) : void { } ,
33
33
log ( ) : void { } ,
@@ -37,7 +37,20 @@ export class ExperimentalSettings {
37
37
} ,
38
38
requestTimeoutMs : 1500 ,
39
39
cacheTimeToLiveSeconds : 60
40
+ } ;
41
+
42
+ this . configcatClient = configcat . createClientWithLazyLoad ( key , {
43
+ baseUrl : new URL ( '/configcat' , this . hostService . gitpodHost ) . href ,
44
+ ...configCatOptions
40
45
} ) ;
46
+
47
+ hostService . onDidChangeHost ( ( ) => {
48
+ this . configcatClient = configcat . createClientWithLazyLoad ( key , {
49
+ baseUrl : new URL ( '/configcat' , this . hostService . gitpodHost ) . href ,
50
+ ...configCatOptions
51
+ } ) ;
52
+ } ) ;
53
+
41
54
this . extensionVersion = new semver . SemVer ( extensionVersion ) ;
42
55
}
43
56
0 commit comments