@@ -4,7 +4,12 @@ const { autoUpdater } = require('electron-updater');
4
4
const { onFirstRunMaybe } = require ( './first-run' ) ;
5
5
const path = require ( 'path' ) ;
6
6
7
- const iconIdle = path . join ( __dirname , 'assets' , 'images' , 'tray-idleTemplate.png' ) ;
7
+ const iconIdle = path . join (
8
+ __dirname ,
9
+ 'assets' ,
10
+ 'images' ,
11
+ 'tray-idleTemplate.png'
12
+ ) ;
8
13
const iconActive = path . join ( __dirname , 'assets' , 'images' , 'tray-active.png' ) ;
9
14
10
15
const browserWindowOpts = {
@@ -17,12 +22,20 @@ const browserWindowOpts = {
17
22
enableRemoteModule : true ,
18
23
overlayScrollbars : true ,
19
24
nodeIntegration : true ,
25
+ contextIsolation : false ,
20
26
} ,
21
27
} ;
22
28
29
+ const delayedHideAppIcon = ( ) =>
30
+ // Setting a timeout because the showDockIcon is not currently working
31
+ // See more at https://github.com/maxogden/menubar/issues/306
32
+ setTimeout ( ( ) => {
33
+ app . dock . hide ( ) ;
34
+ } , 1500 ) ;
35
+
23
36
app . on ( 'ready' , async ( ) => {
24
37
await onFirstRunMaybe ( ) ;
25
- } )
38
+ } ) ;
26
39
27
40
const menubarApp = menubar ( {
28
41
icon : iconIdle ,
@@ -32,6 +45,8 @@ const menubarApp = menubar({
32
45
} ) ;
33
46
34
47
menubarApp . on ( 'ready' , ( ) => {
48
+ delayedHideAppIcon ( ) ;
49
+
35
50
menubarApp . tray . setIgnoreDoubleClickEvents ( true ) ;
36
51
37
52
autoUpdater . checkForUpdatesAndNotify ( ) ;
0 commit comments