forked from nmaggioni/Kanbanion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
41 lines (34 loc) · 868 Bytes
/
index.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
const electron = require('electron');
const app = electron.app;
try {
require('electron-debug')();
} catch (e) {
console.log('Package `electron-debug` not found, not enabling debug features.'); // eslint-disable-line no-console
}
require('electron-pug')({ pretty: true }, {});
let mainWindow; // Prevents the main window to be garbage collected
function onClosed() {
mainWindow = null;
}
function createMainWindow() {
const win = new electron.BrowserWindow({
width: 1000,
height: 700
});
win.loadURL(`file://${__dirname}/app/index.pug`);
win.on('closed', onClosed);
return win;
}
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit();
}
});
app.on('activate', () => {
if (!mainWindow) {
mainWindow = createMainWindow();
}
});
app.on('ready', () => {
mainWindow = createMainWindow();
});