1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-11 05:43:41 +00:00

[EC-744] Revert PolicyService back to clearing DecryptedPolicies on StateService (#4042)

This commit is contained in:
Rui Tomé
2022-11-11 17:20:14 +00:00
committed by GitHub
parent 0e78910582
commit 2d6174af4a

View File

@@ -222,11 +222,13 @@ export class PolicyService implements InternalPolicyServiceAbstraction {
policies[policy.id] = policy;
await this.updateObservables(policies);
await this.stateService.setDecryptedPolicies(null);
await this.stateService.setEncryptedPolicies(policies);
}
async replace(policies: { [id: string]: PolicyData }): Promise<void> {
await this.updateObservables(policies);
await this.stateService.setDecryptedPolicies(null);
await this.stateService.setEncryptedPolicies(policies);
}
@@ -234,6 +236,7 @@ export class PolicyService implements InternalPolicyServiceAbstraction {
if (userId == null || userId == (await this.stateService.getUserId())) {
this._policies.next([]);
}
await this.stateService.setDecryptedPolicies(null, { userId: userId });
await this.stateService.setEncryptedPolicies(null, { userId: userId });
}