From 3a20f24f7ce69a85660ed74714eaecfc6e68585e Mon Sep 17 00:00:00 2001 From: Jan Prochazka Date: Sun, 24 Apr 2022 22:28:04 +0200 Subject: [PATCH] app startup fix --- app/src/electron.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/electron.js b/app/src/electron.js index 9526f373..4b014a1c 100644 --- a/app/src/electron.js +++ b/app/src/electron.js @@ -21,6 +21,7 @@ const { settings } = require('cluster'); const configRootPath = path.join(app.getPath('userData'), 'config-root.json'); let initialConfig = {}; let apiLoaded = false; +let mainModule; const isMac = () => os.platform() == 'darwin'; @@ -337,9 +338,10 @@ function createWindow() { // ); const main = api.getMainModule(); main.useAllControllers(null, electron); + mainModule = main; apiLoaded = true; } - main.setElectronSender(mainWindow.webContents); + mainModule.setElectronSender(mainWindow.webContents); loadMainWindow(); @@ -349,7 +351,7 @@ function createWindow() { // in an array if your app supports multi windows, this is the time // when you should delete the corresponding element. mainWindow = null; - main.setElectronSender(null); + mainModule.setElectronSender(null); }); }