Skip to content

Commit

Permalink
Add exit button for error dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
reyery committed Oct 16, 2024
1 parent c9f231e commit 3ff61cb
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions electron/main.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -327,15 +327,18 @@ function createSplashWindow(url) {
const errorMessage = error?.message
? `Details:\n${error.message}\n\n`
: '';
dialog.showMessageBoxSync(splashWindow, {
const index = dialog.showMessageBoxSync(splashWindow, {
type: 'error',
title: 'CEA Error',
message:
'CEA has encounted an error on startup.\n The application will exit now.',
detail: `${errorMessage}You can report this error to us at our GitHub page\n (https://github.com/architecture-building-systems/CityEnergyAnalyst/issues).`,
buttons: ['Show logs'],
buttons: ['Show logs', 'Exit'],
defaultId: 0,
cancelId: 1,
});
openLog();

if (index == 0) openLog();
app.exit();
}
});
Expand Down

0 comments on commit 3ff61cb

Please sign in to comment.