1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 01:03:35 +00:00

Auth/PM-5712 - Extension & Desktop Account Switcher - Fix incorrect env showing when adding new accounts (#13362)

* PM-5712 - Refactor env service to require user id instead of having global and active user state fallbacks per working session with Justin.

* PM-5712 - AccountSwitcherService tests - fix tests and add env assertions.
This commit is contained in:
Jared Snider
2025-02-25 17:58:26 -05:00
committed by GitHub
parent cec117459b
commit 44d50a70c2
6 changed files with 65 additions and 91 deletions

View File

@@ -110,7 +110,9 @@ export class AccountSwitcherComponent implements OnInit {
name: active.name,
email: active.email,
avatarColor: await firstValueFrom(this.avatarService.avatarColor$),
server: (await this.environmentService.getEnvironment())?.getHostname(),
server: (
await firstValueFrom(this.environmentService.getEnvironment$(active.id))
)?.getHostname(),
};
}),
);
@@ -221,7 +223,9 @@ export class AccountSwitcherComponent implements OnInit {
email: baseAccounts[userId].email,
authenticationStatus: await this.authService.getAuthStatus(userId),
avatarColor: await firstValueFrom(this.avatarService.getUserAvatarColor$(userId as UserId)),
server: (await this.environmentService.getEnvironment(userId))?.getHostname(),
server: (
await firstValueFrom(this.environmentService.getEnvironment$(userId as UserId))
)?.getHostname(),
};
}