[SM-387] fix org-switcher sorting (#4236)

This commit is contained in:
Will Martin 2022-12-16 08:47:34 -05:00 committed by GitHub
parent 94b1a7743d
commit 1e53ae4fb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -10,7 +10,10 @@ import type { Organization } from "@bitwarden/common/models/domain/organization"
templateUrl: "org-switcher.component.html",
})
export class OrgSwitcherComponent {
protected organizations$: Observable<Organization[]> = this.organizationService.organizations$;
protected organizations$: Observable<Organization[]> =
this.organizationService.organizations$.pipe(
map((orgs) => orgs.sort((a, b) => a.name.localeCompare(b.name)))
);
protected activeOrganization$: Observable<Organization> = combineLatest([
this.route.paramMap,
this.organizationService.organizations$,