1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-10-24 08:09:59 +02:00

Make decryptedCollections$ always return a non-null value

This commit is contained in:
Thomas Rittson 2024-10-24 14:09:29 +10:00
parent bef8adbda9
commit 6dea30e8f4
No known key found for this signature in database
GPG Key ID: CDDDA03861C35E27
2 changed files with 5 additions and 2 deletions

View File

@ -248,7 +248,7 @@ describe("DefaultCollectionService", () => {
const decryptedState = await firstValueFrom(
collectionService.decryptedCollections$(of(userId)),
);
expect(decryptedState).toBeNull();
expect(decryptedState.length).toEqual(0);
});
it("clear", async () => {

View File

@ -70,7 +70,10 @@ export class DefaultCollectionvNextService implements CollectionvNextService {
}
decryptedCollections$(userId$: Observable<UserId>) {
return userId$.pipe(switchMap((userId) => this.decryptedCollectionState(userId).state$));
return userId$.pipe(
switchMap((userId) => this.decryptedCollectionState(userId).state$),
map((collections) => collections ?? []),
);
}
async upsert(toUpdate: CollectionData | CollectionData[], userId: UserId): Promise<void> {