Skip to content

Commit

Permalink
code cleanup (bitwarden#6238)
Browse files Browse the repository at this point in the history
  • Loading branch information
jprusik committed Sep 20, 2023
1 parent 8c06508 commit 014b32b
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions libs/common/src/vault/services/cipher.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -398,14 +398,21 @@ export class CipherService implements CipherServiceAbstraction {
defaultMatch ??= await this.stateService.getDefaultUriMatch();

return ciphers.filter((cipher) => {
if (cipher.deletedDate != null) {
const cipherIsLogin = cipher.type === CipherType.Login && cipher.login !== null;

if (cipher.deletedDate !== null) {
return false;
}
if (includeOtherTypes != null && includeOtherTypes.indexOf(cipher.type) > -1) {

if (
Array.isArray(includeOtherTypes) &&
includeOtherTypes.includes(cipher.type) &&
!cipherIsLogin
) {
return true;
}

if (cipher.type === CipherType.Login && cipher.login !== null) {
if (cipherIsLogin) {
return cipher.login.matchesUri(url, equivalentDomains, defaultMatch);
}

Expand Down

0 comments on commit 014b32b

Please sign in to comment.