mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 08:43:33 +00:00
search cipher id as well
This commit is contained in:
@@ -7,14 +7,16 @@ import { CipherView } from '../../models/view/cipherView';
|
|||||||
|
|
||||||
import { PlatformUtilsService } from '../../abstractions/platformUtils.service';
|
import { PlatformUtilsService } from '../../abstractions/platformUtils.service';
|
||||||
|
|
||||||
|
import { DeviceType } from '../../enums';
|
||||||
|
|
||||||
@Pipe({
|
@Pipe({
|
||||||
name: 'searchCiphers',
|
name: 'searchCiphers',
|
||||||
})
|
})
|
||||||
export class SearchCiphersPipe implements PipeTransform {
|
export class SearchCiphersPipe implements PipeTransform {
|
||||||
private onlySearchName = false;
|
private onlySearchName = false;
|
||||||
|
|
||||||
constructor(private platformUtilsService: PlatformUtilsService) {
|
constructor(platformUtilsService: PlatformUtilsService) {
|
||||||
this.onlySearchName = platformUtilsService.isEdge();
|
this.onlySearchName = platformUtilsService.getDevice() === DeviceType.EdgeExtension;
|
||||||
}
|
}
|
||||||
|
|
||||||
transform(ciphers: CipherView[], searchText: string): CipherView[] {
|
transform(ciphers: CipherView[], searchText: string): CipherView[] {
|
||||||
@@ -34,6 +36,9 @@ export class SearchCiphersPipe implements PipeTransform {
|
|||||||
if (this.onlySearchName) {
|
if (this.onlySearchName) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (c.id.substr(0, 8) === searchText) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
if (c.subTitle != null && c.subTitle.toLowerCase().indexOf(searchText) > -1) {
|
if (c.subTitle != null && c.subTitle.toLowerCase().indexOf(searchText) > -1) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user