1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-11 05:43:41 +00:00

[PM-18869][defect] - browser - vault list not updating after favorite/unfavorite (#13669)

* fix type errors to allow vault list update after favoriting

* add null to failedToDecryptCiphers$ return type

* add null to failedToDecryptCiphers$ return type
This commit is contained in:
Jordan Aasen
2025-04-01 10:38:23 -07:00
committed by GitHub
parent 3003d129c9
commit c73404e5f6
4 changed files with 6 additions and 7 deletions

View File

@@ -170,7 +170,7 @@ export class VaultV2Component implements OnInit, AfterViewInit, OnDestroy {
this.cipherService
.failedToDecryptCiphers$(activeUserId)
.pipe(
map((ciphers) => ciphers.filter((c) => !c.isDeleted)),
map((ciphers) => (ciphers ? ciphers.filter((c) => !c.isDeleted) : [])),
filter((ciphers) => ciphers.length > 0),
take(1),
takeUntilDestroyed(this.destroyRef),

View File

@@ -108,7 +108,7 @@ export class VaultPopupItemsService {
this.cipherService.failedToDecryptCiphers$(userId),
]),
),
map(([ciphers, failedToDecryptCiphers]) => [...failedToDecryptCiphers, ...ciphers]),
map(([ciphers, failedToDecryptCiphers]) => [...(failedToDecryptCiphers || []), ...ciphers]),
),
),
shareReplay({ refCount: true, bufferSize: 1 }),

View File

@@ -12,7 +12,6 @@ import {
startWith,
switchMap,
take,
tap,
} from "rxjs";
import { CollectionService, CollectionView } from "@bitwarden/admin-console/common";
@@ -360,10 +359,10 @@ export class VaultPopupListFiltersService {
switchMap((userId) => {
// Observable of cipher views
const cipherViews$ = this.cipherService.cipherViews$(userId).pipe(
tap((cipherViews) => {
this.cipherViews = Object.values(cipherViews);
map((ciphers) => {
this.cipherViews = ciphers ? Object.values(ciphers) : [];
return this.cipherViews;
}),
map((ciphers) => Object.values(ciphers)),
);
return combineLatest([

View File

@@ -31,7 +31,7 @@ export abstract class CipherService implements UserKeyRotationDataProvider<Ciphe
*
* An empty array indicates that all ciphers were successfully decrypted.
*/
abstract failedToDecryptCiphers$(userId: UserId): Observable<CipherView[]>;
abstract failedToDecryptCiphers$(userId: UserId): Observable<CipherView[] | null>;
abstract clearCache(userId: UserId): Promise<void>;
abstract encrypt(
model: CipherView,