File tree Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,15 @@ app.on('ready', function() {
4343 ] ) ;
4444
4545 trayIcon . setToolTip ( 'GitHub Notifications on your menu bar.' ) ;
46- trayIcon . setContextMenu ( trayMenu ) ;
46+
47+ if ( isLinux ) {
48+ trayIcon . setContextMenu ( trayMenu ) ;
49+ } else {
50+ trayIcon . on ( 'click' , ( ) => {
51+ appWindow . isFocused ( ) ? appWindow . hide ( ) : appWindow . show ( ) ;
52+ } ) ;
53+ }
54+
4755 return trayIcon ;
4856 }
4957
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ const browserWindow = {
3434 } ,
3535 on : ( ) => { } ,
3636 close : jest . fn ( ) ,
37+ hide : jest . fn ( ) ,
3738 destroy : jest . fn ( ) ,
3839} ;
3940
@@ -48,6 +49,7 @@ module.exports = {
4849 app : {
4950 getVersion : ( ) => '0.0.1' ,
5051 } ,
52+ getCurrentWindow : jest . fn ( ( ) => browserWindow ) ,
5153 } ,
5254 ipcRenderer : {
5355 send : jest . fn ( ) ,
Original file line number Diff line number Diff line change 1+ const { remote } = require ( 'electron' ) ;
2+
13import { reOpenWindow , openExternalLink } from '../utils/comms' ;
24import { generateGitHubWebUrl } from '../utils/helpers' ;
35
@@ -55,7 +57,10 @@ export default {
5557
5658 nativeNotification . onclick = function ( ) {
5759 if ( count === 1 ) {
60+ const appWindow = remote . getCurrentWindow ( ) ;
5861 const url = generateGitHubWebUrl ( notificationUrl ) ;
62+
63+ appWindow . hide ( ) ;
5964 openExternalLink ( url ) ;
6065 } else {
6166 reOpenWindow ( ) ;
You can’t perform that action at this time.
0 commit comments