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