From 4493cfc2f9d873c1fcfeaaefec5d7fc86e3c32e1 Mon Sep 17 00:00:00 2001 From: Thomas Rittson Date: Wed, 30 Mar 2022 10:30:14 +1000 Subject: [PATCH] Update variable naming: use result convention --- common/src/services/crypto.service.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/common/src/services/crypto.service.ts b/common/src/services/crypto.service.ts index 8e91c0ae..e267e825 100644 --- a/common/src/services/crypto.service.ts +++ b/common/src/services/crypto.service.ts @@ -210,7 +210,7 @@ export class CryptoService implements CryptoServiceAbstraction { @sequentialize(() => "getOrgKeys") async getOrgKeys(): Promise> { - const orgKeys: Map = new Map(); + const result: Map = new Map(); 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 {