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

Commit

Permalink
Fixes start miniized
Browse files Browse the repository at this point in the history
  • Loading branch information
andia89 committed Mar 16, 2020
1 parent 78e8672 commit e4f6746
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions electron/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,17 @@ function createWindow () {
if ( config.get('user_agent').length > 0 ) mainWindow.webContents.setUserAgent( config.get('user_agent') );

if ( !config.get('start_minimized') && config.get('maximized') ) mainWindow.maximize();
if ( config.get('window_display_behavior') !== 'show_trayIcon' && config.get('start_minimized') ) {
// Wait for the mainWindow.loadURL(..) and the optional mainWindow.webContents.openDevTools()
// to be finished before minimizing
mainWindow.webContents.once('did-finish-load', function(e) {
mainWindow.minimize();
});
if (config.get('start_minimized')){
if (config.get('window_display_behavior') == 'show_taskbar') {
mainWindow.webContents.once('did-finish-load', function(e) {
mainWindow.minimize();
});
}
else {
mainWindow.webContents.once('did-finish-load', function(e) {
mainWindow.hide();
});
}
}

// Check if the window its outside of the view (ex: multi monitor setup)
Expand Down

0 comments on commit e4f6746

Please sign in to comment.