Skip to content

Commit

Permalink
Merge branch 'master' into migrate-from-remote-to-ipc
Browse files Browse the repository at this point in the history
  • Loading branch information
Araxeus authored Apr 9, 2022
2 parents 28b5645 + 2f218ef commit cb910a6
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions tray.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const path = require("path");

const { Menu, nativeImage, Tray } = require("electron");
const { app, Menu, nativeImage, Tray } = require("electron");

const { restart } = require("./providers/app-controls");
const config = require("./config");
Expand Down Expand Up @@ -28,7 +28,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();
}
}
});

Expand All @@ -55,13 +61,14 @@ module.exports.setUpTray = (app, win) => {
label: "Show",
click: () => {
win.show();
app.dock?.show();
},
},
{
label: "Restart App",
click: restart
},
{ role: "quit" }
{ role: "quit" },
];

const trayMenu = Menu.buildFromTemplate(template);
Expand Down

0 comments on commit cb910a6

Please sign in to comment.