-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
31 lines (26 loc) · 792 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
"use strict";
const { app, BrowserWindow } = require("electron");
const fs = require("fs");
const path = require("path");
const config = require("./js/config");
// when app is ready, open new window and check for config file
app.on("ready", function () {
const configPath = path.join(path.resolve("."), "config.json");
const win = new BrowserWindow({
width: 810,
height: 475,
autoHideMenuBar: true,
webPreferences: {
nodeIntegration: true,
contextIsolation: false
}
});
win.loadFile(path.resolve(__dirname, "index.html"));
if (!fs.existsSync(configPath)) {
config.initConfig();
}
});
// when all windows are closed, quit the app
app.on("window-all-closed", function () {
app.quit();
});