forked from K-RT-Dev/VGT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
45 lines (38 loc) · 1.2 KB
/
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
const { app } = require('electron');
const { createMainWindow } = require('./electron/windows/winMain');
const {
createCaptureWinShortcutHandler,
} = require('./electron/handlers/shortcutsHandler');
const { initBackend } = require('./electron/helpers/backendRunner');
const { ipcHandler } = require('./electron/handlers/ipcHandler');
const {
checkInitialConfig,
resetConfig,
resetFirstInit,
} = require('./electron/helpers/config');
const { initModelSequence } = require('./electron/helpers/initModelSequence');
//resetConfig();
//resetFirstInit();
checkInitialConfig(); //Setea las configuraciones iniciales y/o carga las configuraciones guardadas
ipcHandler(); //Inicia los handlers
initBackend(); //Inicia el backend
app.on('ready', () => {
//Iniciamos la secuencia de carga de modelos del back, cuando estamos listos cargamos la ventana principal
initModelSequence().then(() => {
createMainWindow();
createCaptureWinShortcutHandler();
});
});
/* Necesario ??
app.on('activate', () => {
if (mainWindow === null) {
createMainWindow();
}
});
*/
//Si cerramos con CTRL+C esto no se ejecuta
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit();
}
});