mirror of
https://github.com/bitwarden/browser
synced 2025-12-27 13:43:41 +00:00
Pass ciphers to index and indexed ciphers to search service (#318)
This commit is contained in:
@@ -28,7 +28,7 @@ export class SearchService implements SearchServiceAbstraction {
|
||||
return !notSearchable;
|
||||
}
|
||||
|
||||
async indexCiphers(): Promise<void> {
|
||||
async indexCiphers(ciphers?: CipherView[]): Promise<void> {
|
||||
if (this.indexing) {
|
||||
return;
|
||||
}
|
||||
@@ -60,7 +60,7 @@ export class SearchService implements SearchServiceAbstraction {
|
||||
builder.field('attachments_joined',
|
||||
{ extractor: (c: CipherView) => this.attachmentExtractor(c, true) });
|
||||
builder.field('organizationid', { extractor: (c: CipherView) => c.organizationId });
|
||||
const ciphers = await this.cipherService.getAllDecrypted();
|
||||
ciphers = ciphers || await this.cipherService.getAllDecrypted();
|
||||
ciphers.forEach(c => builder.add(c));
|
||||
this.index = builder.build();
|
||||
this.indexing = false;
|
||||
|
||||
Reference in New Issue
Block a user