From 3eec7babf682c6ae56c3f1ce7f3c805a03b51211 Mon Sep 17 00:00:00 2001 From: Hinton Date: Sat, 10 Dec 2022 19:26:23 +0100 Subject: [PATCH] Resolve review feedback --- libs/common/src/interfaces/crypto.interface.ts | 4 ++-- libs/common/src/services/crypto.service.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/common/src/interfaces/crypto.interface.ts b/libs/common/src/interfaces/crypto.interface.ts index 5b3ce876cb68..fab310dd968e 100644 --- a/libs/common/src/interfaces/crypto.interface.ts +++ b/libs/common/src/interfaces/crypto.interface.ts @@ -1,7 +1,7 @@ import { EncryptService } from "../abstractions/encrypt.service"; import { SymmetricCryptoKey } from "../models/domain/symmetric-crypto-key"; -export function nullableFactory any>( +export function nullableFactory any>( c: T, ...args: ConstructorParameters ): InstanceType | undefined { @@ -9,7 +9,7 @@ export function nullableFactory any>( return null; } - return new c(...(args as any[])); + return new c(...args); } /** diff --git a/libs/common/src/services/crypto.service.ts b/libs/common/src/services/crypto.service.ts index b2de3e04e97d..aca4e77e563e 100644 --- a/libs/common/src/services/crypto.service.ts +++ b/libs/common/src/services/crypto.service.ts @@ -690,7 +690,7 @@ export class CryptoService implements CryptoServiceAbstraction { ): Promise { const key = await this.getKeyFromIdentifier(domain.keyIdentifier()); - return this.encryptService.decryptDomain(view, domain as DecryptableDomain, key); + return await this.encryptService.decryptDomain(view, domain, key); } async encryptView>>( @@ -698,7 +698,7 @@ export class CryptoService implements CryptoServiceAbstraction { ): Promise> { const key = await this.getKeyFromIdentifier(view.keyIdentifier()); - return this.encryptService.encryptView(view as Encryptable>, key); + return this.encryptService.encryptView(view, key); } private async getKeyFromIdentifier(keyIdentifier: string | null): Promise {