From 40f355d0ea31a11c4f63c31f308d6fd186fb8682 Mon Sep 17 00:00:00 2001 From: Mo Date: Sat, 12 Aug 2023 06:24:58 -0500 Subject: [PATCH] chore: fix dep --- .../UseCase/TypeA/DecryptErroredPayloads.ts | 15 +++------------ .../lib/Application/Dependencies/Dependencies.ts | 4 +--- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/packages/services/src/Domain/Encryption/UseCase/TypeA/DecryptErroredPayloads.ts b/packages/services/src/Domain/Encryption/UseCase/TypeA/DecryptErroredPayloads.ts index 56a6845eb..e8555591c 100644 --- a/packages/services/src/Domain/Encryption/UseCase/TypeA/DecryptErroredPayloads.ts +++ b/packages/services/src/Domain/Encryption/UseCase/TypeA/DecryptErroredPayloads.ts @@ -6,18 +6,14 @@ import { PayloadEmitSource, SureFindPayload, } from '@standardnotes/models' +import { isErrorDecryptingParameters } from '@standardnotes/encryption' import { PayloadManagerInterface } from '../../../Payloads/PayloadManagerInterface' -import { isErrorDecryptingParameters, EncryptionOperatorsInterface } from '@standardnotes/encryption' import { DecryptTypeAPayloadWithKeyLookup } from './DecryptPayloadWithKeyLookup' -import { RootKeyManager } from '../../../RootKeyManager/RootKeyManager' -import { KeySystemKeyManagerInterface } from '../../../KeySystem/KeySystemKeyManagerInterface' export class DecryptErroredTypeAPayloads { constructor( private payloads: PayloadManagerInterface, - private operatorManager: EncryptionOperatorsInterface, - private keySystemKeyManager: KeySystemKeyManagerInterface, - private rootKeyManager: RootKeyManager, + private _decryptTypeAPayloadWithKeyLookup: DecryptTypeAPayloadWithKeyLookup, ) {} async execute(): Promise { @@ -29,12 +25,7 @@ export class DecryptErroredTypeAPayloads { return } - const usecase = new DecryptTypeAPayloadWithKeyLookup( - this.operatorManager, - this.keySystemKeyManager, - this.rootKeyManager, - ) - const resultParams = await usecase.executeMany(erroredRootPayloads) + const resultParams = await this._decryptTypeAPayloadWithKeyLookup.executeMany(erroredRootPayloads) const decryptedPayloads = resultParams.map((params) => { const original = SureFindPayload(erroredRootPayloads, params.uuid) diff --git a/packages/snjs/lib/Application/Dependencies/Dependencies.ts b/packages/snjs/lib/Application/Dependencies/Dependencies.ts index 1e05dc9ef..d41fd53ac 100644 --- a/packages/snjs/lib/Application/Dependencies/Dependencies.ts +++ b/packages/snjs/lib/Application/Dependencies/Dependencies.ts @@ -755,9 +755,7 @@ export class Dependencies { this.factory.set(TYPES.DecryptErroredTypeAPayloads, () => { return new DecryptErroredTypeAPayloads( this.get(TYPES.PayloadManager), - this.get(TYPES.EncryptionOperators), - this.get(TYPES.KeySystemKeyManager), - this.get(TYPES.RootKeyManager), + this.get(TYPES.DecryptTypeAPayloadWithKeyLookup), ) })