mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-19 06:04:05 +00:00
refactor: escalate severe to electron
This commit is contained in:
committed by
Carlos Valente
parent
d41cd78f2e
commit
8742b790f3
@@ -41,7 +41,7 @@ async function startBackend() {
|
||||
|
||||
await initAssets();
|
||||
|
||||
const result = await startServer();
|
||||
const result = await startServer(escalateError);
|
||||
loaded = result.message;
|
||||
|
||||
await startIntegrations();
|
||||
@@ -86,6 +86,11 @@ function askToQuit() {
|
||||
win.send('user-request-shutdown');
|
||||
}
|
||||
|
||||
function escalateError(error) {
|
||||
dialog.showErrorBox('An unrecoverable error occurred', error);
|
||||
app.quit();
|
||||
}
|
||||
|
||||
// Ensure there isn't another instance of the app running already
|
||||
const lock = app.requestSingleInstanceLock();
|
||||
if (!lock) {
|
||||
@@ -213,11 +218,8 @@ app.whenReady().then(() => {
|
||||
const trayMenuTemplate = getTrayMenu(bringToFront, askToQuit);
|
||||
const trayContextMenu = Menu.buildFromTemplate(trayMenuTemplate);
|
||||
tray.setContextMenu(trayContextMenu);
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
// unregister shortcuts before quitting
|
||||
app.once('will-quit', () => {
|
||||
globalShortcut.unregisterAll();
|
||||
|
||||
Reference in New Issue
Block a user