-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
40 lines (32 loc) · 975 Bytes
/
main.js
File metadata and controls
40 lines (32 loc) · 975 Bytes
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
const {app, BrowserWindow, ipcMain} = require('electron');
const EventEmitter = require('events');
const event_main = new EventEmitter();
const create_window = () =>{
const window = new BrowserWindow({
width: 854,
height: 480,
"minHeight": 630,
"minWidth": 1130,
webPreferences: {
nodeIntegration: true,
contextIsolation: false,
devTools: true,
}
});
//disables menu
window.setMenu(null);
window.loadFile(`src/pages/loading_page/loading_page.html`);
event_main.on('connect_success', () => {
window.loadFile(`src/pages/init.html`);
});
event_main.on('logout',() => {
window.loadFile(`src/pages/login/login.html`);
})
}
app.whenReady().then(create_window);
ipcMain.on('connect_success', (event) => {
setTimeout(() => event_main.emit('connect_success'), 1000);
});
ipcMain.on('logout', (event) => {
event_main.emit('logout');
})