This repository was archived by the owner on Apr 22, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +4
-14
lines changed Expand file tree Collapse file tree 1 file changed +4
-14
lines changed Original file line number Diff line number Diff line change @@ -107,20 +107,10 @@ function createWindow () {
107
107
108
108
// Check if user has defined a custom User-Agent
109
109
if ( config . get ( 'user_agent' ) . length > 0 ) mainWindow . webContents . setUserAgent ( config . get ( 'user_agent' ) ) ;
110
-
111
- if ( ! config . get ( 'start_minimized' ) && config . get ( 'maximized' ) ) mainWindow . maximize ( ) ;
112
- if ( config . get ( 'start_minimized' ) ) {
113
- if ( config . get ( 'window_display_behavior' ) == 'show_taskbar' ) {
114
- mainWindow . webContents . once ( 'did-finish-load' , function ( e ) {
115
- mainWindow . minimize ( ) ;
116
- } ) ;
117
- }
118
- else {
119
- mainWindow . webContents . once ( 'did-finish-load' , function ( e ) {
120
- mainWindow . hide ( ) ;
121
- } ) ;
122
- }
123
- }
110
+
111
+ // Wait for the mainWindow.loadURL(..) and the optional mainWindow.webContents.openDevTools()
112
+ // to be finished before minimizing
113
+ config . get ( 'start_minimized' ) && mainWindow . webContents . once ( 'did-finish-load' , ( ) => config . get ( 'window_display_behavior' ) === 'show_trayIcon' ? mainWindow . hide ( ) : mainWindow . minimize ( ) ) ;
124
114
125
115
// Check if the window its outside of the view (ex: multi monitor setup)
126
116
const { positionOnScreen } = require ( './utils/positionOnScreen' ) ;
You can’t perform that action at this time.
0 commit comments