1
0
mirror of https://github.com/bitwarden/desktop synced 2026-02-21 03:43:24 +00:00

[bug] Ensure the avatar instance used in the account switcher updates on account change

This commit is contained in:
addison
2021-11-05 10:08:22 -04:00
parent b9da4457a7
commit 76f9d3221d
2 changed files with 5 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
<a class="account-switcher" (click)="toggle()" cdkOverlayOrigin #trigger="cdkOverlayOrigin">
<app-avatar [data]="activeAccountEmail" size="25" [circle]="true" [fontSize]="14" *ngIf="activeAccountEmail != null"></app-avatar>
<app-avatar [data]="activeAccountEmail" size="25" [circle]="true" [fontSize]="14" [dynamic]="true" *ngIf="activeAccountEmail != null"></app-avatar>
<span>{{activeAccountEmail}}</span>
<i class="fa" aria-hidden="true" [ngClass]="{'fa-chevron-down': !isOpen, 'fa-chevron-up': isOpen}"></i>
</a>

View File

@@ -37,8 +37,10 @@ export class AccountSwitcherComponent implements OnInit {
private messagingService: MessagingService) {}
async ngOnInit(): Promise<void> {
this.stateService.accounts.subscribe(accounts => this.accounts = accounts);
this.activeAccountEmail = await this.stateService.getEmail();
this.stateService.accounts.subscribe(async accounts => {
this.accounts = accounts
this.activeAccountEmail = await this.stateService.getEmail();
});
}
toggle() {