1
0
mirror of https://github.com/bitwarden/browser synced 2026-03-01 19:11:22 +00:00

Update Organization and Policy Services to allow the passing of a user id and to prevent hangs waiting on an active user (#8712)

* OrgSvc - add new observable returning getAll$ method which accepts a required user id

* OrgSvc - make user id optional

* PolicySvc - getAll$ should use the new OrgSvc.getAll$ method so that it doesn't hang if there isn't an active user yet but a user id was passed in.

* Fix policy service tests
This commit is contained in:
Jared Snider
2024-04-12 10:21:19 -04:00
committed by GitHub
parent b914260705
commit 5f97f4c4a8
4 changed files with 16 additions and 3 deletions

View File

@@ -73,6 +73,10 @@ export class OrganizationService implements InternalOrganizationServiceAbstracti
return this.organizations$.pipe(mapToSingleOrganization(id));
}
getAll$(userId?: UserId): Observable<Organization[]> {
return this.getOrganizationsFromState$(userId);
}
async getAll(userId?: string): Promise<Organization[]> {
return await firstValueFrom(this.getOrganizationsFromState$(userId as UserId));
}