mirror of
https://github.com/bitwarden/browser
synced 2025-12-12 22:33:35 +00:00
[EC-744] Revert PolicyService back to clearing DecryptedPolicies on StateService (#4042)
This commit is contained in:
@@ -222,11 +222,13 @@ export class PolicyService implements InternalPolicyServiceAbstraction {
|
|||||||
policies[policy.id] = policy;
|
policies[policy.id] = policy;
|
||||||
|
|
||||||
await this.updateObservables(policies);
|
await this.updateObservables(policies);
|
||||||
|
await this.stateService.setDecryptedPolicies(null);
|
||||||
await this.stateService.setEncryptedPolicies(policies);
|
await this.stateService.setEncryptedPolicies(policies);
|
||||||
}
|
}
|
||||||
|
|
||||||
async replace(policies: { [id: string]: PolicyData }): Promise<void> {
|
async replace(policies: { [id: string]: PolicyData }): Promise<void> {
|
||||||
await this.updateObservables(policies);
|
await this.updateObservables(policies);
|
||||||
|
await this.stateService.setDecryptedPolicies(null);
|
||||||
await this.stateService.setEncryptedPolicies(policies);
|
await this.stateService.setEncryptedPolicies(policies);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -234,6 +236,7 @@ export class PolicyService implements InternalPolicyServiceAbstraction {
|
|||||||
if (userId == null || userId == (await this.stateService.getUserId())) {
|
if (userId == null || userId == (await this.stateService.getUserId())) {
|
||||||
this._policies.next([]);
|
this._policies.next([]);
|
||||||
}
|
}
|
||||||
|
await this.stateService.setDecryptedPolicies(null, { userId: userId });
|
||||||
await this.stateService.setEncryptedPolicies(null, { userId: userId });
|
await this.stateService.setEncryptedPolicies(null, { userId: userId });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user