Skip to content

Commit 661d83d

Browse files
authored
Skip login step from "Turn on Remote Tunnel Access" when already logged (microsoft#166706)
1 parent 15f3444 commit 661d83d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/vs/workbench/contrib/remoteTunnel/electron-sandbox/remoteTunnel.contribution.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,11 +262,16 @@ export class RemoteTunnelWorkbenchContribution extends Disposable implements IWo
262262
}
263263

264264
private async getAccountPreference(): Promise<ExistingSessionItem | undefined> {
265+
const sessions = await this.getAllSessions();
266+
if (sessions.length === 1) {
267+
return sessions[0];
268+
}
269+
265270
const quickpick = this.quickInputService.createQuickPick<ExistingSessionItem | AuthenticationProviderOption | IQuickPickItem>();
266271
quickpick.ok = false;
267272
quickpick.placeholder = localize('accountPreference.placeholder', "Sign in to an account to enable remote access");
268273
quickpick.ignoreFocusOut = true;
269-
quickpick.items = await this.createQuickpickItems();
274+
quickpick.items = await this.createQuickpickItems(sessions);
270275

271276
return new Promise((resolve, reject) => {
272277
quickpick.onDidHide((e) => {
@@ -300,12 +305,11 @@ export class RemoteTunnelWorkbenchContribution extends Disposable implements IWo
300305
};
301306
}
302307

303-
private async createQuickpickItems(): Promise<(ExistingSessionItem | AuthenticationProviderOption | IQuickPickSeparator | IQuickPickItem & { canceledAuthentication: boolean })[]> {
308+
private async createQuickpickItems(sessions: ExistingSessionItem[]): Promise<(ExistingSessionItem | AuthenticationProviderOption | IQuickPickSeparator | IQuickPickItem & { canceledAuthentication: boolean })[]> {
304309
const options: (ExistingSessionItem | AuthenticationProviderOption | IQuickPickSeparator | IQuickPickItem & { canceledAuthentication: boolean })[] = [];
305310

306311
options.push({ type: 'separator', label: localize('signed in', "Signed In") });
307312

308-
const sessions = await this.getAllSessions();
309313
options.push(...sessions);
310314

311315
options.push({ type: 'separator', label: localize('others', "Others") });

0 commit comments

Comments
 (0)