forked from sqlectron/sqlectron-gui
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathapp_main.js
34 lines (27 loc) · 1.06 KB
/
app_main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
var { app, dialog } =require('electron'); // eslint-disable-line import/no-unresolved
var createLogger =require('./logger');
var { buildNewWindow } =require('./window');
const logger = createLogger('app');
// TODO: Create a server to receive the crash reports
// Report crashes to our server.
// require('crash-reporter').start({
// productName: 'Sqlectron',
// companyName: 'Sqlectron',
// submitURL: 'https://your-domain.com/url-to-submit',
// autoSubmit: true
// });
app.allowRendererProcessReuse=false;
// Quit when all windows are closed.
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit();
}
});
// This method will be called when Electron has done everything
// initialization and ready for creating browser windows.
app.on('ready', () => buildNewWindow(app));
// Show only the error description to the user
process.on('uncaughtException', error => {
logger.error('uncaughtException', error);
return dialog.showErrorBox('An error occurred', error.name + ': ' + error.message);
});