diff --git a/src/app/vault/ciphers.component.ts b/src/app/vault/ciphers.component.ts index 50afe5e496..04470455b4 100644 --- a/src/app/vault/ciphers.component.ts +++ b/src/app/vault/ciphers.component.ts @@ -18,6 +18,8 @@ import { CipherType } from 'jslib/enums/cipherType'; import { CipherView } from 'jslib/models/view/cipherView'; +import { SearchCiphersPipe } from 'jslib/angular/pipes/search-ciphers.pipe'; + const MaxCheckedCount = 500; @Component({ @@ -32,10 +34,13 @@ export class CiphersComponent extends BaseCiphersComponent { cipherType = CipherType; + private searchPipe: SearchCiphersPipe; + constructor(cipherService: CipherService, protected analytics: Angulartics2, protected toasterService: ToasterService, protected i18nService: I18nService, protected platformUtilsService: PlatformUtilsService) { super(cipherService); + this.searchPipe = new SearchCiphersPipe(platformUtilsService); } checkCipher(c: CipherView, select?: boolean) { @@ -46,9 +51,14 @@ export class CiphersComponent extends BaseCiphersComponent { if (select) { this.selectAll(false); } - const selectCount = select && this.ciphers.length > MaxCheckedCount ? MaxCheckedCount : this.ciphers.length; + let filteredCiphers = this.ciphers; + if (select) { + filteredCiphers = this.searchPipe.transform(this.ciphers, this.searchText); + } + const selectCount = select && filteredCiphers.length > MaxCheckedCount ? + MaxCheckedCount : filteredCiphers.length; for (let i = 0; i < selectCount; i++) { - this.checkCipher(this.ciphers[i], select); + this.checkCipher(filteredCiphers[i], select); } }