1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-10 21:33:27 +00:00

[PM-16194] Do not sort Favorite ciphers by last used date (#12466)

* [PM-16194] Do not sort Favorite ciphers by last used date

* [PM-16194] Remove test
This commit is contained in:
Shane Melton
2024-12-19 14:47:58 -08:00
committed by GitHub
parent fff412665f
commit 69d42a73e3
2 changed files with 1 additions and 11 deletions

View File

@@ -262,13 +262,6 @@ describe("VaultPopupItemsService", () => {
});
});
it("should sort by last used then by name", (done) => {
service.favoriteCiphers$.subscribe((ciphers) => {
expect(cipherServiceMock.sortCiphersByLastUsedThenName).toHaveBeenCalled();
done();
});
});
it("should filter favoriteCiphers$ down to search term", (done) => {
const cipherList = Object.values(allCiphers);
const searchText = "Card 2";

View File

@@ -164,16 +164,13 @@ export class VaultPopupItemsService {
/**
* List of favorite ciphers that are not currently suggested for autofill.
* Ciphers are sorted by last used date, then by name.
* Ciphers are sorted by name.
*/
favoriteCiphers$: Observable<PopupCipherView[]> = this.autoFillCiphers$.pipe(
withLatestFrom(this._filteredCipherList$),
map(([autoFillCiphers, ciphers]) =>
ciphers.filter((cipher) => cipher.favorite && !autoFillCiphers.includes(cipher)),
),
map((ciphers) =>
ciphers.sort((a, b) => this.cipherService.sortCiphersByLastUsedThenName(a, b)),
),
shareReplay({ refCount: false, bufferSize: 1 }),
);