Merge pull request #3253 from nemec/master

Allow Mac users to close and re-open window
This commit is contained in:
zadam 2022-10-28 20:08:38 +02:00 committed by GitHub
commit 9bc6cf7067
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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 {