From 2d6174af4a2f9ec1ee462c8e69fbec2e5a6c1e4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rui=20Tom=C3=A9?= <108268980+r-tome@users.noreply.github.com> Date: Fri, 11 Nov 2022 17:20:14 +0000 Subject: [PATCH] [EC-744] Revert PolicyService back to clearing DecryptedPolicies on StateService (#4042) --- libs/common/src/services/policy/policy.service.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libs/common/src/services/policy/policy.service.ts b/libs/common/src/services/policy/policy.service.ts index 3dfe345633..757c3b3e05 100644 --- a/libs/common/src/services/policy/policy.service.ts +++ b/libs/common/src/services/policy/policy.service.ts @@ -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 { 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 }); }