1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-11 13:53:34 +00:00

only search name on edge

This commit is contained in:
Kyle Spearrin
2018-04-12 15:42:22 -04:00
parent 286e839ebb
commit c2bdabc098

View File

@@ -5,10 +5,18 @@ import {
import { CipherView } from '../../models/view/cipherView';
import { PlatformUtilsService } from '../../abstractions/platformUtils.service';
@Pipe({
name: 'searchCiphers',
})
export class SearchCiphersPipe implements PipeTransform {
private onlySearchName = false;
constructor(private platformUtilsService: PlatformUtilsService) {
this.onlySearchName = platformUtilsService.isEdge();
}
transform(ciphers: CipherView[], searchText: string): CipherView[] {
if (ciphers == null || ciphers.length === 0) {
return [];
@@ -23,6 +31,9 @@ export class SearchCiphersPipe implements PipeTransform {
if (c.name != null && c.name.toLowerCase().indexOf(searchText) > -1) {
return true;
}
if (this.onlySearchName) {
return false;
}
if (c.subTitle != null && c.subTitle.toLowerCase().indexOf(searchText) > -1) {
return true;
}