fix: startup exception

This commit is contained in:
Fabio Di Stasio 2022-08-15 18:13:53 +02:00
parent 0f219cf9b7
commit c50d17e82b
1 changed files with 18 additions and 18 deletions

View File

@ -130,6 +130,24 @@ else {
if (isDevelopment)
mainWindow.webContents.openDevTools();
app.on('browser-window-focus', () => {
// Send registered shortcut events to window
shortCutRegister.init();
if (isDevelopment) { // Dev shortcuts
globalShortcut.register('Shift+CommandOrControl+F5', () => {
mainWindow.reload();
});
globalShortcut.register('Shift+CommandOrControl+F12', () => {
mainWindow.webContents.openDevTools();
});
}
});
app.on('browser-window-blur', () => {
shortCutRegister.unregister();
});
process.on('uncaughtException', error => {
mainWindow.webContents.send('unhandled-exception', error);
});
@ -146,24 +164,6 @@ else {
window.webContents.session.loadExtension(extensionPath, { allowFileAccess: true }).catch(console.error);
}
});
app.on('browser-window-focus', () => {
// Send registered shortcut events to window
shortCutRegister.init();
if (isDevelopment) { // Dev shortcuts
globalShortcut.register('Shift+CommandOrControl+F5', () => {
mainWindow.reload();
});
globalShortcut.register('Shift+CommandOrControl+F12', () => {
mainWindow.webContents.openDevTools();
});
}
});
app.on('browser-window-blur', () => {
shortCutRegister.unregister();
});
}
function createAppMenu () {