File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed
Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -166,10 +166,7 @@ app.on("activate", () => {
166166app . on ( "ready" , ( ) => {
167167 setApplicationMenu ( ) ;
168168 mainWindow = createMainWindow ( ) ;
169- const tray = setUpTray ( app , mainWindow ) ;
170- tray . on ( "click" , ( ) => {
171- mainWindow . isVisible ( ) ? mainWindow . hide ( ) : mainWindow . show ( ) ;
172- } ) ;
169+ setUpTray ( app , mainWindow ) ;
173170
174171 if ( ! is . dev ( ) && autoUpdate ( ) ) {
175172 autoUpdater . checkForUpdatesAndNotify ( ) ;
Original file line number Diff line number Diff line change @@ -23,6 +23,9 @@ module.exports.setUpTray = (app, win) => {
2323 tray = new Tray ( trayIcon ) ;
2424 tray . setToolTip ( "Youtube Music" ) ;
2525 tray . setIgnoreDoubleClickEvents ( true ) ;
26+ tray . on ( "click" , ( ) => {
27+ win . isVisible ( ) ? win . hide ( ) : win . show ( ) ;
28+ } ) ;
2629
2730 const trayMenu = Menu . buildFromTemplate ( [
2831 {
@@ -67,6 +70,4 @@ module.exports.setUpTray = (app, win) => {
6770 } ,
6871 ] ) ;
6972 tray . setContextMenu ( trayMenu ) ;
70-
71- return tray ;
7273} ;
You can’t perform that action at this time.
0 commit comments