From 76f9d3221d59888e12dc725a984a9902ad1bb4c5 Mon Sep 17 00:00:00 2001 From: addison Date: Fri, 5 Nov 2021 10:08:22 -0400 Subject: [PATCH] [bug] Ensure the avatar instance used in the account switcher updates on account change --- src/app/layout/account-switcher.component.html | 2 +- src/app/layout/account-switcher.component.ts | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/app/layout/account-switcher.component.html b/src/app/layout/account-switcher.component.html index b5b6f9f1..07039583 100644 --- a/src/app/layout/account-switcher.component.html +++ b/src/app/layout/account-switcher.component.html @@ -1,5 +1,5 @@ - + {{activeAccountEmail}} diff --git a/src/app/layout/account-switcher.component.ts b/src/app/layout/account-switcher.component.ts index 59e41a7f..7533c446 100644 --- a/src/app/layout/account-switcher.component.ts +++ b/src/app/layout/account-switcher.component.ts @@ -37,8 +37,10 @@ export class AccountSwitcherComponent implements OnInit { private messagingService: MessagingService) {} async ngOnInit(): Promise { - 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() {