Skip to content
This repository was archived by the owner on Apr 22, 2022. It is now read-only.

Commit 151caa0

Browse files
authored
Merge pull request #2621 from andia89/minimized
Fixes start minimized
2 parents 168eacb + 2185f32 commit 151caa0

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

electron/main.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,10 @@ function createWindow () {
107107

108108
// Check if user has defined a custom User-Agent
109109
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('window_display_behavior') !== 'show_trayIcon' && config.get('start_minimized') ) {
113-
// Wait for the mainWindow.loadURL(..) and the optional mainWindow.webContents.openDevTools()
114-
// to be finished before minimizing
115-
mainWindow.webContents.once('did-finish-load', function(e) {
116-
mainWindow.minimize();
117-
});
118-
}
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());
119114

120115
// Check if the window its outside of the view (ex: multi monitor setup)
121116
const { positionOnScreen } = require('./utils/positionOnScreen');

0 commit comments

Comments
 (0)