mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 00:56:02 +00:00
app startup fix
This commit is contained in:
@@ -21,6 +21,7 @@ const { settings } = require('cluster');
|
|||||||
const configRootPath = path.join(app.getPath('userData'), 'config-root.json');
|
const configRootPath = path.join(app.getPath('userData'), 'config-root.json');
|
||||||
let initialConfig = {};
|
let initialConfig = {};
|
||||||
let apiLoaded = false;
|
let apiLoaded = false;
|
||||||
|
let mainModule;
|
||||||
|
|
||||||
const isMac = () => os.platform() == 'darwin';
|
const isMac = () => os.platform() == 'darwin';
|
||||||
|
|
||||||
@@ -337,9 +338,10 @@ function createWindow() {
|
|||||||
// );
|
// );
|
||||||
const main = api.getMainModule();
|
const main = api.getMainModule();
|
||||||
main.useAllControllers(null, electron);
|
main.useAllControllers(null, electron);
|
||||||
|
mainModule = main;
|
||||||
apiLoaded = true;
|
apiLoaded = true;
|
||||||
}
|
}
|
||||||
main.setElectronSender(mainWindow.webContents);
|
mainModule.setElectronSender(mainWindow.webContents);
|
||||||
|
|
||||||
loadMainWindow();
|
loadMainWindow();
|
||||||
|
|
||||||
@@ -349,7 +351,7 @@ function createWindow() {
|
|||||||
// in an array if your app supports multi windows, this is the time
|
// in an array if your app supports multi windows, this is the time
|
||||||
// when you should delete the corresponding element.
|
// when you should delete the corresponding element.
|
||||||
mainWindow = null;
|
mainWindow = null;
|
||||||
main.setElectronSender(null);
|
mainModule.setElectronSender(null);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user