Skip to content

Commit 260cd12

Browse files
committed
remove local env & replace URLs only if set and pre-release or debugging
1 parent c90cd8a commit 260cd12

File tree

2 files changed

+16
-17
lines changed

2 files changed

+16
-17
lines changed

src/container.ts

+6-7
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ import type { WebviewViewProxy } from './webviews/webviewsController';
9898
import { WebviewsController } from './webviews/webviewsController';
9999
import { registerWelcomeWebviewPanel } from './webviews/welcome/registration';
100100

101-
export type Environment = 'local' | 'dev' | 'staging' | 'production';
101+
export type Environment = 'dev' | 'staging' | 'production';
102102

103103
export class Container {
104104
static #instance: Container | undefined;
@@ -527,7 +527,6 @@ export class Container {
527527
get env(): Environment {
528528
if (this.prereleaseOrDebugging) {
529529
const env = configuration.getAny('gitkraken.env');
530-
if (env === 'local') return 'local';
531530
if (env === 'dev') return 'dev';
532531
if (env === 'staging') return 'staging';
533532
}
@@ -920,6 +919,11 @@ export class Container {
920919

921920
@memoize()
922921
private get baseGkDevUri(): Uri {
922+
if (this.prereleaseOrDebugging) {
923+
const url: string | undefined = configuration.getAny('gitkraken.url.gkdev.base');
924+
if (url) return Uri.parse(url);
925+
}
926+
923927
if (this.env === 'staging') {
924928
return Uri.parse('https://staging.gitkraken.dev');
925929
}
@@ -928,11 +932,6 @@ export class Container {
928932
return Uri.parse('https://dev.gitkraken.dev');
929933
}
930934

931-
if (this.env === 'local') {
932-
const url: string | undefined = configuration.getAny('gitkraken.url.gkdev.base');
933-
return Uri.parse(url ?? 'http://localhost:3000');
934-
}
935-
936935
return Uri.parse('https://gitkraken.dev');
937936
}
938937

src/plus/gk/serverConnection.ts

+10-10
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ export class ServerConnection implements Disposable {
4848

4949
@memoize()
5050
private get baseApiUri(): Uri {
51+
if (this.container.prereleaseOrDebugging) {
52+
const url: string | undefined = configuration.getAny('gitkraken.url.api');
53+
if (url) return Uri.parse(url);
54+
}
55+
5156
if (this.container.env === 'staging') {
5257
return Uri.parse('https://stagingapi.gitkraken.com');
5358
}
@@ -56,11 +61,6 @@ export class ServerConnection implements Disposable {
5661
return Uri.parse('https://devapi.gitkraken.com');
5762
}
5863

59-
if (this.container.env === 'local') {
60-
const url: string | undefined = configuration.getAny('gitkraken.url.api');
61-
return Uri.parse(url ?? 'http://localhost:3000');
62-
}
63-
6464
return Uri.parse('https://api.gitkraken.com');
6565
}
6666

@@ -70,6 +70,11 @@ export class ServerConnection implements Disposable {
7070

7171
@memoize()
7272
private get baseGkDevApiUri(): Uri {
73+
if (this.container.prereleaseOrDebugging) {
74+
const url: string | undefined = configuration.getAny('gitkraken.url.gkdev.api');
75+
if (url) return Uri.parse(url);
76+
}
77+
7378
if (this.container.env === 'staging') {
7479
return Uri.parse('https://staging-api.gitkraken.dev');
7580
}
@@ -78,11 +83,6 @@ export class ServerConnection implements Disposable {
7883
return Uri.parse('https://dev-api.gitkraken.dev');
7984
}
8085

81-
if (this.container.env === 'local') {
82-
const url: string | undefined = configuration.getAny('gitkraken.url.gkdev.api');
83-
return Uri.parse(url ?? 'http://localhost:3000');
84-
}
85-
8686
return Uri.parse('https://api.gitkraken.dev');
8787
}
8888

0 commit comments

Comments
 (0)