mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-27 12:36:14 +01:00
Revert "no need to just search name on edge any longer"
This reverts commit 20fb4d3a39
.
This commit is contained in:
parent
20fb4d3a39
commit
45cb346be1
@ -5,12 +5,20 @@ import {
|
|||||||
|
|
||||||
import { CipherView } from '../../models/view/cipherView';
|
import { CipherView } from '../../models/view/cipherView';
|
||||||
|
|
||||||
|
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(platformUtilsService: PlatformUtilsService) {
|
||||||
|
this.onlySearchName = platformUtilsService.getDevice() === DeviceType.EdgeExtension;
|
||||||
|
}
|
||||||
|
|
||||||
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 [];
|
||||||
|
@ -3,9 +3,11 @@ import * as lunr from 'lunr';
|
|||||||
import { CipherView } from '../models/view/cipherView';
|
import { CipherView } from '../models/view/cipherView';
|
||||||
|
|
||||||
import { CipherService } from '../abstractions/cipher.service';
|
import { CipherService } from '../abstractions/cipher.service';
|
||||||
|
import { PlatformUtilsService } from '../abstractions/platformUtils.service';
|
||||||
import { SearchService as SearchServiceAbstraction } from '../abstractions/search.service';
|
import { SearchService as SearchServiceAbstraction } from '../abstractions/search.service';
|
||||||
|
|
||||||
import { CipherType } from '../enums/cipherType';
|
import { CipherType } from '../enums/cipherType';
|
||||||
|
import { DeviceType } from '../enums/deviceType';
|
||||||
import { FieldType } from '../enums/fieldType';
|
import { FieldType } from '../enums/fieldType';
|
||||||
import { UriMatchType } from '../enums/uriMatchType';
|
import { UriMatchType } from '../enums/uriMatchType';
|
||||||
|
|
||||||
@ -14,7 +16,10 @@ export class SearchService implements SearchServiceAbstraction {
|
|||||||
private index: lunr.Index = null;
|
private index: lunr.Index = null;
|
||||||
private onlySearchName = false;
|
private onlySearchName = false;
|
||||||
|
|
||||||
constructor(private cipherService: CipherService) { }
|
constructor(private cipherService: CipherService, platformUtilsService: PlatformUtilsService) {
|
||||||
|
this.onlySearchName = platformUtilsService == null ||
|
||||||
|
platformUtilsService.getDevice() === DeviceType.EdgeExtension;
|
||||||
|
}
|
||||||
|
|
||||||
clearIndex(): void {
|
clearIndex(): void {
|
||||||
this.index = null;
|
this.index = null;
|
||||||
|
Loading…
Reference in New Issue
Block a user