mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 00:33:44 +00:00
[PM-12045] search service activeuserstate (#13035)
* removing activeuserstate from search service
This commit is contained in:
@@ -363,7 +363,8 @@ describe("Cipher Service", () => {
|
||||
configService.getFeatureFlag.mockResolvedValue(true);
|
||||
configService.checkServerMeetsVersionRequirement$.mockReturnValue(of(true));
|
||||
|
||||
searchService.indexedEntityId$ = of(null);
|
||||
searchService.indexedEntityId$.mockReturnValue(of(null));
|
||||
|
||||
stateService.getUserId.mockResolvedValue(mockUserId);
|
||||
|
||||
const keys = {
|
||||
|
||||
@@ -165,9 +165,9 @@ export class CipherService implements CipherServiceAbstraction {
|
||||
}
|
||||
if (this.searchService != null) {
|
||||
if (value == null) {
|
||||
await this.searchService.clearIndex();
|
||||
await this.searchService.clearIndex(userId);
|
||||
} else {
|
||||
await this.searchService.indexCiphers(value);
|
||||
await this.searchService.indexCiphers(userId, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -480,9 +480,9 @@ export class CipherService implements CipherServiceAbstraction {
|
||||
private async reindexCiphers(userId: UserId) {
|
||||
const reindexRequired =
|
||||
this.searchService != null &&
|
||||
((await firstValueFrom(this.searchService.indexedEntityId$)) ?? userId) !== userId;
|
||||
((await firstValueFrom(this.searchService.indexedEntityId$(userId))) ?? userId) !== userId;
|
||||
if (reindexRequired) {
|
||||
await this.searchService.indexCiphers(await this.getDecryptedCiphers(userId), userId);
|
||||
await this.searchService.indexCiphers(userId, await this.getDecryptedCiphers(userId), userId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user