mirror of
https://github.com/Fabio286/antares.git
synced 2025-02-17 04:00:48 +01:00
fix: startup exception
This commit is contained in:
parent
0f219cf9b7
commit
c50d17e82b
@ -130,23 +130,6 @@ else {
|
|||||||
if (isDevelopment)
|
if (isDevelopment)
|
||||||
mainWindow.webContents.openDevTools();
|
mainWindow.webContents.openDevTools();
|
||||||
|
|
||||||
process.on('uncaughtException', error => {
|
|
||||||
mainWindow.webContents.send('unhandled-exception', error);
|
|
||||||
});
|
|
||||||
|
|
||||||
process.on('unhandledRejection', error => {
|
|
||||||
mainWindow.webContents.send('unhandled-exception', error);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
app.on('browser-window-created', (event, window) => {
|
|
||||||
if (isDevelopment) {
|
|
||||||
const { antares } = require('../../package.json');
|
|
||||||
const extensionPath = path.resolve(__dirname, `../../misc/${antares.devtoolsId}`);
|
|
||||||
window.webContents.session.loadExtension(extensionPath, { allowFileAccess: true }).catch(console.error);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
app.on('browser-window-focus', () => {
|
app.on('browser-window-focus', () => {
|
||||||
// Send registered shortcut events to window
|
// Send registered shortcut events to window
|
||||||
shortCutRegister.init();
|
shortCutRegister.init();
|
||||||
@ -164,6 +147,23 @@ else {
|
|||||||
app.on('browser-window-blur', () => {
|
app.on('browser-window-blur', () => {
|
||||||
shortCutRegister.unregister();
|
shortCutRegister.unregister();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
process.on('uncaughtException', error => {
|
||||||
|
mainWindow.webContents.send('unhandled-exception', error);
|
||||||
|
});
|
||||||
|
|
||||||
|
process.on('unhandledRejection', error => {
|
||||||
|
mainWindow.webContents.send('unhandled-exception', error);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
app.on('browser-window-created', (event, window) => {
|
||||||
|
if (isDevelopment) {
|
||||||
|
const { antares } = require('../../package.json');
|
||||||
|
const extensionPath = path.resolve(__dirname, `../../misc/${antares.devtoolsId}`);
|
||||||
|
window.webContents.session.loadExtension(extensionPath, { allowFileAccess: true }).catch(console.error);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function createAppMenu () {
|
function createAppMenu () {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user