From 6c93d635d00b8d1aeb3a92193a1cdb4b6bd8374a Mon Sep 17 00:00:00 2001 From: TC Date: Fri, 8 Apr 2022 15:17:26 +0200 Subject: [PATCH] Bring back the app in the dock (MacOS) when it was hidden --- tray.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tray.js b/tray.js index b89902ab..10e0bba1 100644 --- a/tray.js +++ b/tray.js @@ -1,6 +1,6 @@ const path = require("path"); -const { Menu, nativeImage, Tray } = require("electron"); +const { app, Menu, nativeImage, Tray } = require("electron"); const config = require("./config"); const getSongControls = require("./providers/song-controls"); @@ -27,7 +27,13 @@ module.exports.setUpTray = (app, win) => { if (config.get("options.trayClickPlayPause")) { playPause(); } else { - win.isVisible() ? win.hide() : win.show(); + if (win.isVisible()) { + win.hide(); + app.dock?.hide(); + } else { + win.show(); + app.dock?.show(); + } } }); @@ -54,6 +60,7 @@ module.exports.setUpTray = (app, win) => { label: "Show", click: () => { win.show(); + app.dock?.show(); }, }, {