Skip to content

Commit a7fb3ef

Browse files
author
Rachel Macfarlane
committed
Fix sign out confirmation message
1 parent 349b16d commit a7fb3ef

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/vs/workbench/api/browser/mainThreadAuthentication.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ function readAccountUsages(storageService: IStorageService, providerId: string,
4343
return usages;
4444
}
4545

46+
function removeAccountUsage(storageService: IStorageService, providerId: string, accountName: string): void {
47+
const accountKey = `${providerId}-${accountName}-usages`;
48+
storageService.remove(accountKey, StorageScope.GLOBAL);
49+
}
50+
4651
function addAccountUsage(storageService: IStorageService, providerId: string, accountName: string, extensionId: string, extensionName: string) {
4752
const accountKey = `${providerId}-${accountName}-usages`;
4853
const usages = readAccountUsages(storageService, providerId, accountName);
@@ -196,12 +201,13 @@ export class MainThreadAuthenticationProvider extends Disposable {
196201
const result = await dialogService.confirm({
197202
title: nls.localize('signOutConfirm', "Sign out of {0}", session.account.displayName),
198203
message: accountUsages.length
199-
? nls.localize('signOutMessage', "The account {0} has been used by: \n\n{1}\n\n Sign out of these features?", session.account.displayName, accountUsages.map(usage => usage.extensionName).join('\n'))
200-
: ''
204+
? nls.localize('signOutMessagve', "The account {0} has been used by: \n\n{1}\n\n Sign out of these features?", session.account.displayName, accountUsages.map(usage => usage.extensionName).join('\n'))
205+
: nls.localize('signOutMessageSimple', "Sign out of {0}?", session.account.displayName)
201206
});
202207

203208
if (result.confirmed) {
204209
sessionsForAccount?.forEach(sessionId => this.logout(sessionId));
210+
removeAccountUsage(this.storageService, this.id, session.account.displayName);
205211
}
206212
}
207213

0 commit comments

Comments
 (0)