提交 d116e9e0 编写于 作者: S Sandeep Somavarapu

group by signed in

上级 ed9be86c
......@@ -252,28 +252,32 @@ export class UserDataSyncAccounts extends Disposable {
private createQuickpickItems(): (AccountQuickPickItem | IQuickPickSeparator)[] {
const quickPickItems: (AccountQuickPickItem | IQuickPickSeparator)[] = [];
const authenticationProviders = [...this.authenticationProviders].sort(({ id }) => id === this.current?.authenticationProviderId ? -1 : 1);
for (const authenticationProvider of authenticationProviders) {
const providerName = this.authenticationService.getDisplayName(authenticationProvider.id);
if (this.all.length) {
quickPickItems.push({ type: 'separator', label: providerName });
const accounts = this._all.get(authenticationProvider.id) || [];
// Signed in Accounts
if (this.all.length) {
const authenticationProviders = [...this.authenticationProviders].sort(({ id }) => id === this.current?.authenticationProviderId ? -1 : 1);
quickPickItems.push({ type: 'separator', label: localize('signed in', "Signed in") });
for (const authenticationProvider of authenticationProviders) {
const accounts = (this._all.get(authenticationProvider.id) || []).sort(({ sessionId }) => sessionId === this.current?.sessionId ? -1 : 1);
const providerName = this.authenticationService.getDisplayName(authenticationProvider.id);
for (const account of accounts) {
quickPickItems.push({
label: account.accountName,
label: `${account.accountName} (${providerName})`,
description: account.sessionId === this.current?.sessionId ? localize('last used', "Last Used with Sync") : undefined,
account,
authenticationProvider,
});
}
quickPickItems.push({
label: accounts.length ? localize('use another', "Use another {0} Account", providerName) : localize('use provider account', "Use {0} Account", providerName),
authenticationProvider,
});
} else {
quickPickItems.push({ label: providerName, authenticationProvider });
}
quickPickItems.push({ type: 'separator', label: localize('others', "Others") });
}
// Account proviers
for (const authenticationProvider of this.authenticationProviders) {
const providerName = this.authenticationService.getDisplayName(authenticationProvider.id);
quickPickItems.push({ label: localize('sign in using account', "Sign in with {0}", providerName), authenticationProvider });
}
return quickPickItems;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册