mirror of
https://github.com/bitwarden/jslib
synced 2025-12-10 21:33:17 +00:00
Simplify logic
This commit is contained in:
@@ -1,7 +1,3 @@
|
|||||||
export class EncryptedOrganizationKeyData {
|
export class EncryptedOrganizationKeyData {
|
||||||
constructor(public key: string, public providerId?: string) {}
|
constructor(public key: string, public providerId?: string) {}
|
||||||
|
|
||||||
static fromObj(obj: { key: string; providerId?: string }) {
|
|
||||||
return new EncryptedOrganizationKeyData(obj.key, obj.providerId);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ export class CryptoService implements CryptoServiceAbstraction {
|
|||||||
|
|
||||||
const allOrgs = orgs.concat(providerOrgs);
|
const allOrgs = orgs.concat(providerOrgs);
|
||||||
allOrgs.forEach((org) => {
|
allOrgs.forEach((org) => {
|
||||||
encOrgKeyData[org.id] = EncryptedOrganizationKeyData.fromObj(org);
|
encOrgKeyData[org.id] = new EncryptedOrganizationKeyData(org.key, org.providerId);
|
||||||
});
|
});
|
||||||
|
|
||||||
await this.stateService.setDecryptedOrganizationKeys(null);
|
await this.stateService.setDecryptedOrganizationKeys(null);
|
||||||
|
|||||||
Reference in New Issue
Block a user