mirror of
https://github.com/bitwarden/browser
synced 2025-12-28 14:13:22 +00:00
init view properties
This commit is contained in:
@@ -10,6 +10,10 @@ import {
|
||||
|
||||
import { ImportResult } from '../models/domain/importResult';
|
||||
|
||||
import { CipherType } from '../enums/cipherType';
|
||||
|
||||
import { Utils } from '../misc/utils';
|
||||
|
||||
import { CipherRequest } from '../models/request/cipherRequest';
|
||||
import { CollectionRequest } from '../models/request/collectionRequest';
|
||||
import { FolderRequest } from '../models/request/folderRequest';
|
||||
@@ -278,6 +282,6 @@ export class ImportService implements ImportServiceAbstraction {
|
||||
|
||||
private badData(c: CipherView) {
|
||||
return (c.name == null || c.name === '--') &&
|
||||
(c.login != null && (c.login.password == null || c.login.password === ''));
|
||||
(c.type === CipherType.Login && c.login != null && Utils.isNullOrWhitespace(c.login.password));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ export class SearchService implements SearchServiceAbstraction {
|
||||
});
|
||||
builder.field('notes');
|
||||
(builder as any).field('login.username', {
|
||||
extractor: (c: CipherView) => c.login != null ? c.login.username : null,
|
||||
extractor: (c: CipherView) => c.type === CipherType.Login && c.login != null ? c.login.username : null,
|
||||
});
|
||||
(builder as any).field('login.uris', { boost: 2, extractor: (c: CipherView) => this.uriExtractor(c) });
|
||||
(builder as any).field('fields', { extractor: (c: CipherView) => this.fieldExtractor(c, false) });
|
||||
@@ -198,7 +198,7 @@ export class SearchService implements SearchServiceAbstraction {
|
||||
}
|
||||
|
||||
private uriExtractor(c: CipherView) {
|
||||
if (c.login == null || !c.login.hasUris) {
|
||||
if (c.type !== CipherType.Login || c.login == null || !c.login.hasUris) {
|
||||
return null;
|
||||
}
|
||||
const uris: string[] = [];
|
||||
|
||||
Reference in New Issue
Block a user