@@ -262,11 +262,16 @@ export class RemoteTunnelWorkbenchContribution extends Disposable implements IWo
262
262
}
263
263
264
264
private async getAccountPreference ( ) : Promise < ExistingSessionItem | undefined > {
265
+ const sessions = await this . getAllSessions ( ) ;
266
+ if ( sessions . length === 1 ) {
267
+ return sessions [ 0 ] ;
268
+ }
269
+
265
270
const quickpick = this . quickInputService . createQuickPick < ExistingSessionItem | AuthenticationProviderOption | IQuickPickItem > ( ) ;
266
271
quickpick . ok = false ;
267
272
quickpick . placeholder = localize ( 'accountPreference.placeholder' , "Sign in to an account to enable remote access" ) ;
268
273
quickpick . ignoreFocusOut = true ;
269
- quickpick . items = await this . createQuickpickItems ( ) ;
274
+ quickpick . items = await this . createQuickpickItems ( sessions ) ;
270
275
271
276
return new Promise ( ( resolve , reject ) => {
272
277
quickpick . onDidHide ( ( e ) => {
@@ -300,12 +305,11 @@ export class RemoteTunnelWorkbenchContribution extends Disposable implements IWo
300
305
} ;
301
306
}
302
307
303
- private async createQuickpickItems ( ) : Promise < ( ExistingSessionItem | AuthenticationProviderOption | IQuickPickSeparator | IQuickPickItem & { canceledAuthentication : boolean } ) [ ] > {
308
+ private async createQuickpickItems ( sessions : ExistingSessionItem [ ] ) : Promise < ( ExistingSessionItem | AuthenticationProviderOption | IQuickPickSeparator | IQuickPickItem & { canceledAuthentication : boolean } ) [ ] > {
304
309
const options : ( ExistingSessionItem | AuthenticationProviderOption | IQuickPickSeparator | IQuickPickItem & { canceledAuthentication : boolean } ) [ ] = [ ] ;
305
310
306
311
options . push ( { type : 'separator' , label : localize ( 'signed in' , "Signed In" ) } ) ;
307
312
308
- const sessions = await this . getAllSessions ( ) ;
309
313
options . push ( ...sessions ) ;
310
314
311
315
options . push ( { type : 'separator' , label : localize ( 'others' , "Others" ) } ) ;
0 commit comments