mirror of
https://github.com/bitwarden/browser.git
synced 2024-10-29 07:59:42 +01:00
only search name on edge
This commit is contained in:
parent
286e839ebb
commit
c2bdabc098
@ -5,10 +5,18 @@ import {
|
|||||||
|
|
||||||
import { CipherView } from '../../models/view/cipherView';
|
import { CipherView } from '../../models/view/cipherView';
|
||||||
|
|
||||||
|
import { PlatformUtilsService } from '../../abstractions/platformUtils.service';
|
||||||
|
|
||||||
@Pipe({
|
@Pipe({
|
||||||
name: 'searchCiphers',
|
name: 'searchCiphers',
|
||||||
})
|
})
|
||||||
export class SearchCiphersPipe implements PipeTransform {
|
export class SearchCiphersPipe implements PipeTransform {
|
||||||
|
private onlySearchName = false;
|
||||||
|
|
||||||
|
constructor(private platformUtilsService: PlatformUtilsService) {
|
||||||
|
this.onlySearchName = platformUtilsService.isEdge();
|
||||||
|
}
|
||||||
|
|
||||||
transform(ciphers: CipherView[], searchText: string): CipherView[] {
|
transform(ciphers: CipherView[], searchText: string): CipherView[] {
|
||||||
if (ciphers == null || ciphers.length === 0) {
|
if (ciphers == null || ciphers.length === 0) {
|
||||||
return [];
|
return [];
|
||||||
@ -23,6 +31,9 @@ export class SearchCiphersPipe implements PipeTransform {
|
|||||||
if (c.name != null && c.name.toLowerCase().indexOf(searchText) > -1) {
|
if (c.name != null && c.name.toLowerCase().indexOf(searchText) > -1) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
if (this.onlySearchName) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (c.subTitle != null && c.subTitle.toLowerCase().indexOf(searchText) > -1) {
|
if (c.subTitle != null && c.subTitle.toLowerCase().indexOf(searchText) > -1) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user