Allow Mac users to close and re-open window

This commit is contained in:
Dan Nemec 2022-10-27 19:59:41 -05:00
parent 51aa9a0d6e
commit 5bc4d07aad

View file

@ -1,6 +1,6 @@
'use strict';
const {app, globalShortcut} = require('electron');
const {app, globalShortcut, BrowserWindow} = require('electron');
const sqlInit = require('./src/services/sql_init');
const appIconService = require('./src/services/app_icon');
const windowService = require('./src/services/window');
@ -32,6 +32,14 @@ app.on('ready', async () => {
await windowService.createMainWindow(app);
if (process.platform === 'darwin') {
app.on('activate', async () => {
if (BrowserWindow.getAllWindows().length === 0) {
await windowService.createMainWindow(app);
}
});
}
tray.createTray();
}
else {