Hide from Dock on macOS when the tray icon is enabled and the window is closed

This commit is contained in:
Botond Horvath 2018-07-21 18:37:39 +02:00 committed by Ken Powers
parent bc6d549f20
commit ffb0b5a27b
3 changed files with 29 additions and 0 deletions

17
app/dock_icon.js Normal file
View file

@ -0,0 +1,17 @@
const { app } = require('electron');
const dockIcon = {};
dockIcon.show = () => {
if (process.platform === 'darwin') {
app.dock.show();
}
};
dockIcon.hide = () => {
if (process.platform === 'darwin') {
app.dock.hide();
}
};
module.exports = dockIcon;