mirror of
https://github.com/bitwarden/browser
synced 2026-02-07 12:13:45 +00:00
fix "No Folder" filter
This commit is contained in:
@@ -143,6 +143,17 @@ describe("VaultFilter", () => {
|
||||
|
||||
expect(result).toBe(true);
|
||||
});
|
||||
|
||||
it("should return true when filtering on unassigned folder via empty string id", () => {
|
||||
const filterFunction = createFilterFunction({
|
||||
selectedFolder: true,
|
||||
selectedFolderId: "",
|
||||
});
|
||||
|
||||
const result = filterFunction(cipher);
|
||||
|
||||
expect(result).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe("given an organizational cipher (with organization and collections)", () => {
|
||||
|
||||
@@ -57,10 +57,19 @@ export class VaultFilter {
|
||||
if (this.cipherType != null && cipherPassesFilter) {
|
||||
cipherPassesFilter = CipherViewLikeUtils.getType(cipher) === this.cipherType;
|
||||
}
|
||||
if (this.selectedFolder && this.selectedFolderId == null && cipherPassesFilter) {
|
||||
cipherPassesFilter = cipher.folderId == null;
|
||||
if (
|
||||
this.selectedFolder &&
|
||||
(this.selectedFolderId == null || this.selectedFolderId === "") &&
|
||||
cipherPassesFilter
|
||||
) {
|
||||
cipherPassesFilter = cipher.folderId == null || cipher.folderId === "";
|
||||
}
|
||||
if (this.selectedFolder && this.selectedFolderId != null && cipherPassesFilter) {
|
||||
if (
|
||||
this.selectedFolder &&
|
||||
this.selectedFolderId != null &&
|
||||
this.selectedFolderId !== "" &&
|
||||
cipherPassesFilter
|
||||
) {
|
||||
cipherPassesFilter = cipher.folderId === this.selectedFolderId;
|
||||
}
|
||||
if (this.selectedCollection && this.selectedCollectionId == null && cipherPassesFilter) {
|
||||
|
||||
Reference in New Issue
Block a user