mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
app startup fix
This commit is contained in:
parent
aa8854da93
commit
3a20f24f7c
@ -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);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user