mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 08:43:33 +00:00
[PM-329] Detangle SearchService & CipherService (#4838)
* Remove Circular Dependency * Fix Vault Searching * Remove Unused cipherServiceOptions * Add searchService Parameter to CipherService * Fix instantiation of CipherService in test
This commit is contained in:
@@ -118,7 +118,7 @@ export class VaultItemsComponent extends BaseVaultItemsComponent implements OnDe
|
||||
protected i18nService: I18nService,
|
||||
protected platformUtilsService: PlatformUtilsService,
|
||||
protected vaultFilterService: VaultFilterService,
|
||||
protected cipherService: CipherService,
|
||||
cipherService: CipherService,
|
||||
protected eventCollectionService: EventCollectionService,
|
||||
protected totpService: TotpService,
|
||||
protected stateService: StateService,
|
||||
@@ -129,7 +129,7 @@ export class VaultItemsComponent extends BaseVaultItemsComponent implements OnDe
|
||||
private organizationService: OrganizationService,
|
||||
private tokenService: TokenService
|
||||
) {
|
||||
super(searchService);
|
||||
super(searchService, cipherService);
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
@@ -223,6 +223,7 @@ export class VaultItemsComponent extends BaseVaultItemsComponent implements OnDe
|
||||
}
|
||||
|
||||
async doSearch(indexedCiphers?: CipherView[]) {
|
||||
indexedCiphers = indexedCiphers ?? (await this.cipherService.getAllDecrypted());
|
||||
this.ciphers = await this.searchService.searchCiphers(
|
||||
this.searchText,
|
||||
[this.filter, this.deletedFilter],
|
||||
|
||||
@@ -110,7 +110,8 @@ export class VaultItemsComponent extends BaseVaultItemsComponent implements OnDe
|
||||
(c) => c.organizationId === this.organization?.id
|
||||
);
|
||||
}
|
||||
await this.searchService.indexCiphers(this.organization?.id, this.allCiphers);
|
||||
|
||||
this.searchService.indexCiphers(this.allCiphers, this.organization?.id);
|
||||
}
|
||||
|
||||
async refreshCollections(): Promise<void> {
|
||||
|
||||
Reference in New Issue
Block a user