events work in electron IPC

This commit is contained in:
Jan Prochazka
2021-12-25 10:52:48 +01:00
parent 6dcbb5e308
commit 185cfab5d8
13 changed files with 68 additions and 40 deletions

View File

@@ -221,11 +221,14 @@ function createWindow() {
}
}
global.API_PACKAGE = process.env.DEVMODE ? '../packages/api/src/index' : '../packages/api/dist/bundle.js';
const api = require(path.join(
__dirname,
process.env.ELECTRON_DEBUG ? '../../packages/api' : '../packages/api/dist/bundle.js'
process.env.DEVMODE ? '../../packages/api/src/index' : '../packages/api/dist/bundle.js'
));
api.getMainModule().useAllControllers(null, electron);
const main = api.getMainModule();
main.initializeElectronSender(mainWindow.webContents);
main.useAllControllers(null, electron);
loadMainWindow();
@@ -267,7 +270,9 @@ function createWindow() {
}
function onAppReady() {
autoUpdater.checkForUpdatesAndNotify();
if (!process.env.DEVMODE) {
autoUpdater.checkForUpdatesAndNotify();
}
createWindow();
}