Polish sign out dialog, fixes #117473

This commit is contained in:
Rachel Macfarlane
2021-02-23 13:12:18 -08:00
parent 67261dc97f
commit 79b14947e7

View File

@@ -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);