1
0
mirror of https://github.com/bitwarden/jslib synced 2025-12-30 15:13:22 +00:00

Update variable naming: use result convention

This commit is contained in:
Thomas Rittson
2022-03-30 10:30:14 +10:00
parent 5c66af8582
commit 4493cfc2f9

View File

@@ -210,7 +210,7 @@ export class CryptoService implements CryptoServiceAbstraction {
@sequentialize(() => "getOrgKeys")
async getOrgKeys(): Promise<Map<string, SymmetricCryptoKey>> {
const orgKeys: Map<string, SymmetricCryptoKey> = new Map<string, SymmetricCryptoKey>();
const result: Map<string, SymmetricCryptoKey> = new Map<string, SymmetricCryptoKey>();
const decryptedOrganizationKeys = await this.stateService.getDecryptedOrganizationKeys();
if (decryptedOrganizationKeys != null && decryptedOrganizationKeys.size > 0) {
return decryptedOrganizationKeys;
@@ -225,20 +225,20 @@ export class CryptoService implements CryptoServiceAbstraction {
for (const orgId in encOrgKeys) {
// eslint-disable-next-line
if (!encOrgKeys.hasOwnProperty(orgId) || orgKeys.has(orgId)) {
if (!encOrgKeys.hasOwnProperty(orgId) || result.has(orgId)) {
continue;
}
const decryptedKey = await encOrgKeys[orgId].decrypt(this);
orgKeys.set(orgId, decryptedKey);
result.set(orgId, decryptedKey);
setKey = true;
}
if (setKey) {
await this.stateService.setDecryptedOrganizationKeys(orgKeys);
await this.stateService.setDecryptedOrganizationKeys(result);
}
return orgKeys;
return result;
}
async getOrgKey(orgId: string): Promise<SymmetricCryptoKey> {