Skip to content

Commit 9a042b1

Browse files
committed
Check if gitpod host got updated or not in case of remote window
1 parent d7e227b commit 9a042b1

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/remoteConnector.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ export class RemoteConnector extends Disposable {
669669
}
670670

671671
await this.sessionService.signIn(params.gitpodHost);
672-
if (!this.sessionService.isSignedIn()) {
672+
if (!this.sessionService.isSignedIn() || new URL(this.hostService.gitpodHost).host !== new URL(params.gitpodHost).host /* remote window case so host didn't update*/) {
673673
return;
674674
}
675675

src/remoteSession.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,13 @@ export class RemoteSession extends Disposable {
253253

254254
private async showRevertGitpodHostDialog() {
255255
const flow: UserFlowTelemetryProperties = { ...this.connectionInfo, flow: 'remote_session' };
256-
const revert = 'Revert change';
257-
const action = await this.notificationService.showErrorMessage(`Cannot change 'gitpod.host' setting while connected to a remote workspace`, { id: 'switch_gitpod_host_remote', flow, modal: true }, revert);
256+
const revert: vscode.MessageItem = { title: 'Revert change' };
257+
const close: vscode.MessageItem = { title: 'Close window', isCloseAffordance: true };
258+
const action = await this.notificationService.showErrorMessage(`Cannot change 'gitpod.host' setting while connected to a remote workspace`, { id: 'switch_gitpod_host_remote', flow, modal: true }, revert, close);
258259
if (action === revert) {
259260
await this.hostService.changeHost(this.connectionInfo.gitpodHost, true);
261+
} else if (action === close) {
262+
vscode.commands.executeCommand('workbench.action.remote.close');
260263
}
261264
}
262265

0 commit comments

Comments
 (0)