Pārlūkot izejas kodu

fix: move the app to system tray when closed

master
kj1352 pirms 1 gada
vecāks
revīzija
7011cdd0c1
1 mainītis faili ar 7 papildinājumiem un 4 dzēšanām
  1. +7
    -4
      main.js

+ 7
- 4
main.js Parādīt failu

@@ -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 = {}) {


Notiek ielāde…
Atcelt
Saglabāt