Add explicit init to native messaging service (#1262)

This commit is contained in:
Oscar Hinton 2022-01-24 16:10:32 +01:00 committed by GitHub
parent ca41cdf8b5
commit 7d46e5c145
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -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,
},

View File

@ -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);
});