1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-13 14:53:33 +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 this.cipherService
.failedToDecryptCiphers$(activeUserId) .failedToDecryptCiphers$(activeUserId)
.pipe( .pipe(
map((ciphers) => ciphers.filter((c) => !c.isDeleted)), map((ciphers) => (ciphers ? ciphers.filter((c) => !c.isDeleted) : [])),
filter((ciphers) => ciphers.length > 0), filter((ciphers) => ciphers.length > 0),
take(1), take(1),
takeUntilDestroyed(this.destroyRef), takeUntilDestroyed(this.destroyRef),

View File

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

View File

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