diff --git a/apps/browser/src/vault/popup/services/vault-popup-items.service.ts b/apps/browser/src/vault/popup/services/vault-popup-items.service.ts index d00c07218cb..ee006646f01 100644 --- a/apps/browser/src/vault/popup/services/vault-popup-items.service.ts +++ b/apps/browser/src/vault/popup/services/vault-popup-items.service.ts @@ -2,7 +2,6 @@ import { inject, Injectable, NgZone } from "@angular/core"; import { toObservable } from "@angular/core/rxjs-interop"; import { combineLatest, - concatMap, distinctUntilChanged, distinctUntilKeyChanged, filter, @@ -240,14 +239,12 @@ export class VaultPopupItemsService { * List of all remaining ciphers that are not currently suggested for autofill or marked as favorite. * Ciphers are sorted by name. */ - remainingCiphers$: Observable = this.favoriteCiphers$.pipe( - concatMap( - ( - favoriteCiphers, // concatMap->of is used to make withLatestFrom lazy to avoid race conditions with autoFillCiphers$ - ) => - of(favoriteCiphers).pipe(withLatestFrom(this._filteredCipherList$, this.autoFillCiphers$)), - ), - map(([favoriteCiphers, ciphers, autoFillCiphers]) => + remainingCiphers$ = combineLatest([ + this._filteredCipherList$, + this.autoFillCiphers$, + this.favoriteCiphers$, + ]).pipe( + map(([ciphers, autoFillCiphers, favoriteCiphers]) => ciphers.filter( (cipher) => !autoFillCiphers.includes(cipher) && !favoriteCiphers.includes(cipher), ), @@ -404,7 +401,11 @@ const waitUntilSync = (syncService: SyncService): MonoTypeOperatorFunction return waitUntil(syncService.activeUserLastSync$().pipe(filter((lastSync) => lastSync != null))); }; -const ciphersEqualByIdAndOrder = (a: PopupCipherViewLike[], b: PopupCipherViewLike[]): boolean => { +const ciphersEqualByIdAndOrder = ( + a: PopupCipherViewLike[], + b: PopupCipherViewLike[], + context?: string, +): boolean => { if (a === b) { return true; }