Skip to content

Commit

Permalink
remove local env & replace URLs only if set and pre-release or debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiolms committed Oct 10, 2024
1 parent c90cd8a commit 8905af3
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ import type { WebviewViewProxy } from './webviews/webviewsController';
import { WebviewsController } from './webviews/webviewsController';
import { registerWelcomeWebviewPanel } from './webviews/welcome/registration';

export type Environment = 'local' | 'dev' | 'staging' | 'production';
export type Environment = 'dev' | 'staging' | 'production';

export class Container {
static #instance: Container | undefined;
Expand Down Expand Up @@ -527,7 +527,6 @@ export class Container {
get env(): Environment {
if (this.prereleaseOrDebugging) {
const env = configuration.getAny('gitkraken.env');
if (env === 'local') return 'local';
if (env === 'dev') return 'dev';
if (env === 'staging') return 'staging';
}
Expand Down Expand Up @@ -920,6 +919,11 @@ export class Container {

@memoize()
private get baseGkDevUri(): Uri {
if (this.prereleaseOrDebugging) {
const url: string | undefined = configuration.getAny('gitkraken.url.gkdev.base');
if (url) return Uri.parse(url);
}

if (this.env === 'staging') {
return Uri.parse('https://staging.gitkraken.dev');
}
Expand All @@ -928,11 +932,6 @@ export class Container {
return Uri.parse('https://dev.gitkraken.dev');
}

if (this.env === 'local') {
const url: string | undefined = configuration.getAny('gitkraken.url.gkdev.base');
return Uri.parse(url ?? 'http://localhost:3000');
}

return Uri.parse('https://gitkraken.dev');
}

Expand Down

0 comments on commit 8905af3

Please sign in to comment.