diff --git a/electron.js b/electron.js index 4dcce6cf3..01f1748ed 100644 --- a/electron.js +++ b/electron.js @@ -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 {