Parcourir la source

fix: move the app to system tray when closed

master
kj1352 il y a 1 an
Parent
révision
7011cdd0c1
1 fichiers modifiés avec 7 ajouts et 4 suppressions
  1. +7
    -4
      main.js

+ 7
- 4
main.js Voir le fichier

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


Chargement…
Annuler
Enregistrer