mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-17 23:45:59 +00:00
events work in electron IPC
This commit is contained in:
@@ -90,7 +90,7 @@
|
||||
},
|
||||
"homepage": "./",
|
||||
"scripts": {
|
||||
"start": "cross-env ELECTRON_START_URL=http://localhost:5000 ELECTRON_DEBUG=1 DEVMODE=1 electron .",
|
||||
"start": "cross-env ELECTRON_START_URL=http://localhost:5000 DEVMODE=1 electron .",
|
||||
"start:local": "cross-env electron .",
|
||||
"dist": "electron-builder",
|
||||
"build": "cd ../packages/api && yarn build && cd ../web && yarn build && cd ../../app && yarn dist",
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user