1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-13 06:43:35 +00:00

[PS-1843] Sort organizations in buildOrganizations (#4015)

* Sort organizations in buildOrganizations

* Add sort by name to Organization Switcher
This commit is contained in:
Justin Baur
2022-11-08 21:56:27 -05:00
committed by GitHub
parent 88de7d2b47
commit d6a6dedbba
2 changed files with 11 additions and 4 deletions

View File

@@ -37,8 +37,13 @@ export class VaultFilterService {
return new Set(await this.stateService.getCollapsedGroupings());
}
buildOrganizations(): Promise<Organization[]> {
return this.organizationService.getAll();
async buildOrganizations(): Promise<Organization[]> {
let organizations = await this.organizationService.getAll();
if (organizations != null) {
organizations = organizations.sort((a, b) => a.name.localeCompare(b.name));
}
return organizations;
}
buildNestedFolders(organizationId?: string): Observable<DynamicTreeNode<FolderView>> {