@@ -114,6 +114,7 @@ const createMainWindow = () => {
114
114
mainWindow = new BrowserWindow ( {
115
115
width : 1280 ,
116
116
height : 1000 ,
117
+ show : false ,
117
118
backgroundColor : shouldUseDarkColors ? '#212224' : '#fff' ,
118
119
icon :
119
120
process . platform === 'win32'
@@ -131,6 +132,7 @@ const createMainWindow = () => {
131
132
} )
132
133
133
134
mainWindow . once ( 'ready-to-show' , ( ) => {
135
+ mainWindow . show ( ) ;
134
136
const endTime = performance . now ( )
135
137
console . log ( `Startup time: ${ ( endTime - startTime ) . toFixed ( 2 ) } ms` )
136
138
} )
@@ -168,8 +170,6 @@ const createMainWindow = () => {
168
170
eventListeners . handleMaximize = handleMaximize
169
171
eventListeners . handleUnmaximize = handleUnmaximize
170
172
171
- //HandleTray(SettingsStore.get('tray'))
172
-
173
173
const customStylesPath : string = SettingsStore . get ( 'customStylesPath' )
174
174
if ( customStylesPath ) {
175
175
fs . readFile ( customStylesPath , 'utf8' , ( error : Error | null , data ) => {
214
214
. whenReady ( )
215
215
. then ( ( ) => {
216
216
startTime = performance . now ( )
217
- createMainWindow ( )
217
+ HandleTray ( )
218
+ const tray = SettingsStore . get ( 'tray' ) ;
219
+ const startMinimized = SettingsStore . get ( 'startMinimized' ) ;
220
+ if ( tray && startMinimized ) {
221
+ app . dock ?. hide ( )
222
+ } else {
223
+ createMainWindow ( )
224
+ }
218
225
eventListeners . handleCreateWindow = handleCreateWindow
219
226
eventListeners . handleWindowAllClosed = handleWindowAllClosed
220
227
eventListeners . handleBeforeQuit = handleBeforeQuit
0 commit comments