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:
parent
bef8adbda9
commit
6dea30e8f4
@ -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 () => {
|
||||
|
@ -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> {
|
||||
|
Loading…
Reference in New Issue
Block a user