diff --git a/src/nostrMiddleware.ts b/src/nostrMiddleware.ts index e91be9f6..4ceddf09 100644 --- a/src/nostrMiddleware.ts +++ b/src/nostrMiddleware.ts @@ -40,8 +40,11 @@ export default (serverMethods: Types.ServerMethods, mainHandler: Main, nostrSett }) let nostr: Nostr; - const managementManager = new ManagementManager((...args: Parameters) => nostr.Send(...args), mainHandler.storage); - mainHandler.managementManager = managementManager; + if (!mainHandler.managementManager) { + throw new Error("management manager not initialized on main handler") + } + + const managementManager = mainHandler.managementManager; nostr = new Nostr(nostrSettings, mainHandler.utils, event => { let j: NostrRequest diff --git a/src/services/main/index.ts b/src/services/main/index.ts index 46670f8a..18e898b8 100644 --- a/src/services/main/index.ts +++ b/src/services/main/index.ts @@ -79,7 +79,6 @@ export default class { this.appUserManager = new AppUserManager(this.storage, this.settings, this.applicationManager) this.debitManager = new DebitManager(this.storage, this.lnd, this.applicationManager) this.offerManager = new OfferManager(this.storage, this.lnd, this.applicationManager, this.productManager, this.liquidityManager) - const nostrSettings = LoadNosrtSettingsFromEnv() this.managementManager = new ManagementManager(this.nostrSend, this.storage) //this.webRTC = new webRTC(this.storage, this.utils) }