mirror of
https://github.com/bitwarden/browser.git
synced 2024-12-22 16:29:09 +01: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:
parent
fff412665f
commit
69d42a73e3
@ -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) => {
|
it("should filter favoriteCiphers$ down to search term", (done) => {
|
||||||
const cipherList = Object.values(allCiphers);
|
const cipherList = Object.values(allCiphers);
|
||||||
const searchText = "Card 2";
|
const searchText = "Card 2";
|
||||||
|
@ -164,16 +164,13 @@ export class VaultPopupItemsService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* List of favorite ciphers that are not currently suggested for autofill.
|
* 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(
|
favoriteCiphers$: Observable<PopupCipherView[]> = this.autoFillCiphers$.pipe(
|
||||||
withLatestFrom(this._filteredCipherList$),
|
withLatestFrom(this._filteredCipherList$),
|
||||||
map(([autoFillCiphers, ciphers]) =>
|
map(([autoFillCiphers, ciphers]) =>
|
||||||
ciphers.filter((cipher) => cipher.favorite && !autoFillCiphers.includes(cipher)),
|
ciphers.filter((cipher) => cipher.favorite && !autoFillCiphers.includes(cipher)),
|
||||||
),
|
),
|
||||||
map((ciphers) =>
|
|
||||||
ciphers.sort((a, b) => this.cipherService.sortCiphersByLastUsedThenName(a, b)),
|
|
||||||
),
|
|
||||||
shareReplay({ refCount: false, bufferSize: 1 }),
|
shareReplay({ refCount: false, bufferSize: 1 }),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user