mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 18:41:47 +00:00
Merge branch 'master' into migrate-from-remote-to-ipc
This commit is contained in:
13
tray.js
13
tray.js
@ -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");
|
||||
@ -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();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@ -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);
|
||||
|
||||
Reference in New Issue
Block a user