mirror of
https://github.com/bitwarden/browser
synced 2025-12-19 09:43:23 +00:00
Unset active account when adding additional accounts (#1258)
This commit is contained in:
@@ -65,7 +65,9 @@ export class AccountSwitcherComponent implements OnInit {
|
||||
];
|
||||
|
||||
get showSwitcher() {
|
||||
return !Utils.isNullOrWhitespace(this.activeAccountEmail);
|
||||
const userIsInAVault = !Utils.isNullOrWhitespace(this.activeAccountEmail);
|
||||
const userIsAddingAnAdditionalAccount = Object.keys(this.accounts).length > 0;
|
||||
return userIsInAVault || userIsAddingAnAdditionalAccount;
|
||||
}
|
||||
|
||||
get numberOfAccounts() {
|
||||
@@ -111,6 +113,11 @@ export class AccountSwitcherComponent implements OnInit {
|
||||
this.messagingService.send("switchAccount", { userId: userId });
|
||||
}
|
||||
|
||||
async addAccount() {
|
||||
this.toggle();
|
||||
await this.stateService.setActiveUser(null);
|
||||
}
|
||||
|
||||
private async createSwitcherAccounts(baseAccounts: {
|
||||
[userId: string]: Account;
|
||||
}): Promise<{ [userId: string]: SwitcherAccount }> {
|
||||
|
||||
Reference in New Issue
Block a user