mirror of
https://github.com/zadam/trilium.git
synced 2025-01-15 03:27:44 +08:00
Allow Mac users to close and re-open window
This commit is contained in:
parent
51aa9a0d6e
commit
5bc4d07aad
1 changed files with 9 additions and 1 deletions
10
electron.js
10
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 {
|
||||
|
|
Loading…
Reference in a new issue