1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-05 09:10:53 +01:00

search cipher id as well

This commit is contained in:
Kyle Spearrin 2018-07-11 15:47:54 -04:00
parent d7f3f9425e
commit ef75dc735e

View File

@ -7,14 +7,16 @@ import { CipherView } from '../../models/view/cipherView';
import { PlatformUtilsService } from '../../abstractions/platformUtils.service';
import { DeviceType } from '../../enums';
@Pipe({
name: 'searchCiphers',
})
export class SearchCiphersPipe implements PipeTransform {
private onlySearchName = false;
constructor(private platformUtilsService: PlatformUtilsService) {
this.onlySearchName = platformUtilsService.isEdge();
constructor(platformUtilsService: PlatformUtilsService) {
this.onlySearchName = platformUtilsService.getDevice() === DeviceType.EdgeExtension;
}
transform(ciphers: CipherView[], searchText: string): CipherView[] {
@ -34,6 +36,9 @@ export class SearchCiphersPipe implements PipeTransform {
if (this.onlySearchName) {
return false;
}
if (c.id.substr(0, 8) === searchText) {
return true;
}
if (c.subTitle != null && c.subTitle.toLowerCase().indexOf(searchText) > -1) {
return true;
}