mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-26 03:29:00 +01:00
Polish sign out dialog, fixes #117473
This commit is contained in:
@@ -74,14 +74,20 @@ export class MainThreadAuthenticationProvider extends Disposable {
|
||||
async removeAccountSessions(accountName: string, sessions: modes.AuthenticationSession[]): Promise<void> {
|
||||
const accountUsages = readAccountUsages(this.storageService, this.id, accountName);
|
||||
|
||||
const result = await this.dialogService.confirm({
|
||||
title: nls.localize('signOutConfirm', "Sign out of {0}", accountName),
|
||||
message: accountUsages.length
|
||||
? nls.localize('signOutMessagve', "The account {0} has been used by: \n\n{1}\n\n Sign out of these features?", accountName, accountUsages.map(usage => usage.extensionName).join('\n'))
|
||||
: nls.localize('signOutMessageSimple', "Sign out of {0}?", accountName)
|
||||
});
|
||||
const result = await this.dialogService.show(
|
||||
Severity.Info,
|
||||
accountUsages.length
|
||||
? nls.localize('signOutMessagve', "The account '{0}' has been used by: \n\n{1}\n\n Sign out from these extensions?", accountName, accountUsages.map(usage => usage.extensionName).join('\n'))
|
||||
: nls.localize('signOutMessageSimple', "Sign out of '{0}'?", accountName),
|
||||
[
|
||||
nls.localize('signOut', "Sign out"),
|
||||
nls.localize('cancel', "Cancel")
|
||||
],
|
||||
{
|
||||
cancelId: 1
|
||||
});
|
||||
|
||||
if (result.confirmed) {
|
||||
if (result.choice === 0) {
|
||||
const removeSessionPromises = sessions.map(session => this.removeSession(session.id));
|
||||
await Promise.all(removeSessionPromises);
|
||||
removeAccountUsage(this.storageService, this.id, accountName);
|
||||
|
||||
Reference in New Issue
Block a user