| @@ -40,20 +40,23 @@ app.on('ready', () => { | |||||
| }); | }); | ||||
| function createMainWindow() { | function createMainWindow() { | ||||
| const userDataPath = path.join(app.getPath('userData'), 'Cache'); | |||||
| mainWindow = new BrowserWindow({ | mainWindow = new BrowserWindow({ | ||||
| width: 800, | width: 800, | ||||
| height: 600, | height: 600, | ||||
| webPreferences: { | webPreferences: { | ||||
| preload: path.join(__dirname, 'preload.js'), | preload: path.join(__dirname, 'preload.js'), | ||||
| nodeIntegration: false, | |||||
| contextIsolation: true, | contextIsolation: true, | ||||
| nodeIntegration: false, | |||||
| }, | }, | ||||
| }); | }); | ||||
| app.setPath('userData', userDataPath); | |||||
| mainWindow.loadFile('index.html'); | mainWindow.loadFile('index.html'); | ||||
| // Hide the window instead of quitting | |||||
| mainWindow.on('close', (event) => { | |||||
| event.preventDefault(); | |||||
| mainWindow.hide(); | |||||
| }); | |||||
| } | } | ||||
| async function sendAPIRequest(data = {}) { | async function sendAPIRequest(data = {}) { | ||||