mirror of
https://github.com/bitwarden/browser
synced 2025-12-18 01:03:35 +00:00
[PM-6194] Refactor injection of services in browser services module (#8380)
* refactored injector of services on the browser service module * refactored the search and popup serach service to use state provider * renamed back to default * removed token service that was readded during merge conflict * Updated search service construction on the cli * updated to use user key definition * Reafctored all components that refernce issearchable * removed commented variable * added uncommited code to remove dependencies not needed anymore * added uncommited code to remove dependencies not needed anymore
This commit is contained in:
@@ -89,9 +89,9 @@ export class CipherService implements CipherServiceAbstraction {
|
||||
}
|
||||
if (this.searchService != null) {
|
||||
if (value == null) {
|
||||
this.searchService.clearIndex();
|
||||
await this.searchService.clearIndex();
|
||||
} else {
|
||||
this.searchService.indexCiphers(value);
|
||||
await this.searchService.indexCiphers(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -333,9 +333,10 @@ export class CipherService implements CipherServiceAbstraction {
|
||||
private async reindexCiphers() {
|
||||
const userId = await this.stateService.getUserId();
|
||||
const reindexRequired =
|
||||
this.searchService != null && (this.searchService.indexedEntityId ?? userId) !== userId;
|
||||
this.searchService != null &&
|
||||
((await firstValueFrom(this.searchService.indexedEntityId$)) ?? userId) !== userId;
|
||||
if (reindexRequired) {
|
||||
this.searchService.indexCiphers(await this.getDecryptedCipherCache(), userId);
|
||||
await this.searchService.indexCiphers(await this.getDecryptedCipherCache(), userId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user