diff --git a/src/vs/workbench/api/browser/mainThreadAuthentication.ts b/src/vs/workbench/api/browser/mainThreadAuthentication.ts index 5ba33c07cf6..0aedb3630e1 100644 --- a/src/vs/workbench/api/browser/mainThreadAuthentication.ts +++ b/src/vs/workbench/api/browser/mainThreadAuthentication.ts @@ -120,35 +120,8 @@ export class MainThreadAuthenticationProvider extends Disposable { quickPick.show(); } - private createSignInMenu(hasSessions: boolean): void { - this._signInMenuDisposables.push(CommandsRegistry.registerCommand({ - id: `signIn${this.id}`, - handler: (accessor, args) => { - this.login(); - }, - })); - - this._signInMenuItem = { - group: '2_providers', - command: { - id: `signIn${this.id}`, - title: hasSessions - ? nls.localize('addAnotherAccount', "Sign in to another {0} account", this.displayName) - : nls.localize('addAccount', "Sign in to {0}", this.displayName) - }, - order: 3 - }; - - this._signInMenuDisposables.push(MenuRegistry.appendMenuItem(MenuId.AccountsContext, this._signInMenuItem)); - } - private async registerCommandsAndContextMenuItems(): Promise { const sessions = await this._proxy.$getSessions(this.id); - - if (!sessions.length || (sessions.length && this.supportsMultipleAccounts)) { - this.createSignInMenu(!!sessions.length); - } - sessions.forEach(session => this.registerSession(session)); } @@ -250,8 +223,6 @@ export class MainThreadAuthenticationProvider extends Disposable { if (this._signInMenuItem) { this._signInMenuItem.command.title = nls.localize('addAccount', "Sign in to {0}", this.displayName); - } else { - this.createSignInMenu(false); } } } diff --git a/src/vs/workbench/contrib/userDataSync/browser/userDataSync.ts b/src/vs/workbench/contrib/userDataSync/browser/userDataSync.ts index 9bd5d190f9f..ec5f1c66c14 100644 --- a/src/vs/workbench/contrib/userDataSync/browser/userDataSync.ts +++ b/src/vs/workbench/contrib/userDataSync/browser/userDataSync.ts @@ -695,6 +695,14 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo }, when: turnOnSyncWhenContext, }); + MenuRegistry.appendMenuItem(MenuId.AccountsContext, { + group: '1_sync', + command: { + id: turnOnSyncCommand.id, + title: localize('global activity turn on sync', "Turn on Preferences Sync...") + }, + when: turnOnSyncWhenContext, + }); } private registerSignInAction(): void { @@ -826,6 +834,11 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo group: '5_sync', when, order: 3, + }, + { + id: MenuId.AccountsContext, + group: '1_sync', + when, } ], });