-
Notifications
You must be signed in to change notification settings - Fork 0
/
about.js
44 lines (37 loc) · 910 Bytes
/
about.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
const { BrowserWindow } = require('electron');
const path = require('path');
if (process.env.NODE_ENV === 'development') {
try {
require('electron-reload')(__dirname, {
electron: path.join(__dirname, 'node_modules', '.bin', 'electron'),
awaitWriteFinish: true
});
} catch (error) {
console.error('Error loading electron-reload:', error);
}
}
let aboutWindow;
function createAboutWindow() {
if (aboutWindow) {
aboutWindow.focus();
return;
}
aboutWindow = new BrowserWindow({
width: 500,
height: 310,
resizable: false,
minimizable: false,
maximizable: false,
webPreferences: {
nodeIntegration: true,
contextIsolation: false
}
});
aboutWindow.loadFile(path.join(__dirname, 'about.html'));
aboutWindow.on('closed', () => {
aboutWindow = null;
});
}
module.exports = {
createAboutWindow
};