Hide from Dock on macOS when the tray icon is enabled and the window is closed
This commit is contained in:
parent
bc6d549f20
commit
ffb0b5a27b
3 changed files with 29 additions and 0 deletions
17
app/dock_icon.js
Normal file
17
app/dock_icon.js
Normal 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;
|
Loading…
Add table
Add a link
Reference in a new issue