-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
34 lines (26 loc) · 1006 Bytes
/
app.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
import { app, dialog } from 'electron'; // eslint-disable-line import/no-unresolved
import createLogger from './logger';
import { buildNewWindow } from './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
// });
// 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);
});