From 7d46e5c14564b6f2d0b055d7a15e416e8ea1c81e Mon Sep 17 00:00:00 2001 From: Oscar Hinton Date: Mon, 24 Jan 2022 16:10:32 +0100 Subject: [PATCH] Add explicit init to native messaging service (#1262) --- src/app/services.module.ts | 5 ++++- src/services/nativeMessaging.service.ts | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/app/services.module.ts b/src/app/services.module.ts index e08e555e5f..75e37e4fcd 100644 --- a/src/app/services.module.ts +++ b/src/app/services.module.ts @@ -60,9 +60,11 @@ export function initFactory( notificationsService: NotificationsServiceAbstraction, platformUtilsService: PlatformUtilsServiceAbstraction, stateService: StateServiceAbstraction, - cryptoService: CryptoServiceAbstraction + cryptoService: CryptoServiceAbstraction, + nativeMessagingService: NativeMessagingService ): Function { return async () => { + nativeMessagingService.init(); await stateService.init(); await environmentService.setUrlsFromStorage(); syncService.fullSync(true); @@ -122,6 +124,7 @@ export function initFactory( PlatformUtilsServiceAbstraction, StateServiceAbstraction, CryptoServiceAbstraction, + NativeMessagingService, ], multi: true, }, diff --git a/src/services/nativeMessaging.service.ts b/src/services/nativeMessaging.service.ts index 8c3b897315..c9bfc7901a 100644 --- a/src/services/nativeMessaging.service.ts +++ b/src/services/nativeMessaging.service.ts @@ -33,7 +33,9 @@ export class NativeMessagingService { private messagingService: MessagingService, private vaultTimeoutService: VaultTimeoutService, private stateService: StateService - ) { + ) {} + + init() { ipcRenderer.on("nativeMessaging", async (_event: any, message: any) => { this.messageHandler(message); });