1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 08:13:42 +00:00

Fix logic for list filtering for trash and archived items (#16702)

This commit is contained in:
Nick Krantz
2025-10-02 14:34:15 -05:00
committed by GitHub
parent cac6a36275
commit bbbc10f233

View File

@@ -304,14 +304,14 @@ export class ListCommand {
}
/**
* Checks if the cipher passes either the trash or the archive options.
* @returns true if the cipher passes *any* of the filters
* Checks if the cipher passes the state filter options.
* @returns true if the cipher matches the requested state
*/
private matchesStateOptions(c: CipherView, options: Options): boolean {
const passesTrashFilter = options.trash && c.isDeleted;
const passesArchivedFilter = options.archived && c.isArchived;
const passesTrashFilter = options.trash === c.isDeleted;
const passesArchivedFilter = options.archived === c.isArchived;
return passesTrashFilter || passesArchivedFilter;
return passesTrashFilter && passesArchivedFilter;
}
}