-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.js
50 lines (38 loc) · 945 Bytes
/
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/* eslint strict: 0 */
'use strict';
const electron = require('electron');
const app = electron.app;
const BrowserWindow = electron.BrowserWindow;
const crashReporter = electron.crashReporter;
const postal = require('postal');
let mainWindow = null;
crashReporter.start();
if (process.env.NODE_ENV === 'development') {
require('electron-debug')();
}
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') app.quit();
});
app.on('ready', () => {
mainWindow = new BrowserWindow({
width: 1024,
height: 768,
minWidth: 900,
minHeight: 650
});
mainWindow.openDevTools();
mainWindow.setFullScreen(true);
if (process.env.HOT) {
mainWindow.loadURL(`file://${__dirname}/app/hot-dev-app.html`);
} else {
mainWindow.loadURL(`file://${__dirname}/app/app.html`);
}
/*mainWindow.on('close', (e) => {
if(true) {
e.preventDefault();
}
});*/
mainWindow.on('closed', () => {
mainWindow = null;
});
});