Skip to content

Commit

Permalink
fix: startup exception
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabio286 committed Aug 15, 2022
1 parent 0f219cf commit c50d17e
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions src/main/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand All @@ -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 () {
Expand Down

0 comments on commit c50d17e

Please sign in to comment.