Skip to content

Commit fd85f8d

Browse files
committed
1 parent 9328b32 commit fd85f8d

1 file changed

Lines changed: 15 additions & 11 deletions

File tree

src/vs/workbench/contrib/userDataSync/browser/userDataSyncAccount.ts

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ export class UserDataSyncAccounts extends Disposable {
202202
const quickPick = this.quickInputService.createQuickPick<AccountQuickPickItem>();
203203
disposables.add(quickPick);
204204

205-
quickPick.title = localize('pick an account', "Preferences Sync: Pick an account");
205+
quickPick.title = localize('pick an account', "Preferences Sync");
206206
quickPick.ok = false;
207207
quickPick.placeholder = localize('choose account placeholder', "Select an account");
208208
quickPick.ignoreFocusOut = true;
@@ -225,20 +225,24 @@ export class UserDataSyncAccounts extends Disposable {
225225
const authenticationProviders = [...this.authenticationProviders].sort(({ id }) => id === this.current?.providerId ? -1 : 1);
226226
for (const authenticationProvider of authenticationProviders) {
227227
const providerName = this.authenticationService.getDisplayName(authenticationProvider.id);
228-
quickPickItems.push({ type: 'separator', label: providerName });
229-
const accounts = this._all.get(authenticationProvider.id) || [];
230-
for (const account of accounts) {
228+
if (this.all.length) {
229+
quickPickItems.push({ type: 'separator', label: providerName });
230+
const accounts = this._all.get(authenticationProvider.id) || [];
231+
for (const account of accounts) {
232+
quickPickItems.push({
233+
label: account.accountName,
234+
detail: account.sessionId === this.current?.sessionId ? localize('last used', "Last Used") : undefined,
235+
account,
236+
authenticationProvider,
237+
});
238+
}
231239
quickPickItems.push({
232-
label: account.accountName,
233-
detail: account.sessionId === this.current?.sessionId ? localize('last used', "Last Used") : undefined,
234-
account,
240+
label: accounts.length ? localize('use another', "Use another {0} Account", providerName) : localize('use provider account', "Use {0} Account", providerName),
235241
authenticationProvider,
236242
});
243+
} else {
244+
quickPickItems.push({ label: providerName, authenticationProvider });
237245
}
238-
quickPickItems.push({
239-
label: accounts.length ? localize('choose another', "Use another {0} Account", providerName) : localize('choose', "Use {0} Account", providerName),
240-
authenticationProvider,
241-
});
242246
}
243247
return quickPickItems;
244248
}

0 commit comments

Comments
 (0)