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:
@@ -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>
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user