From f0159e3c02c4f1c59aa1a2e5939088cf3002eabe Mon Sep 17 00:00:00 2001 From: Ramiro Saenz Date: Thu, 4 Apr 2019 20:03:12 -0300 Subject: [PATCH] Prevent execute AutoLaunch on dev --- electron/main.js | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/electron/main.js b/electron/main.js index 37a1faf6..91f90126 100644 --- a/electron/main.js +++ b/electron/main.js @@ -66,11 +66,13 @@ app.setAppUserModelId('com.grupovrs.ramboxce'); const appMenu = require('./menu')(config); // Configure AutoLaunch -const appLauncher = new AutoLaunch({ - name: 'Rambox' - ,isHidden: config.get('start_minimized') -}); -config.get('auto_launch') && !isDev ? appLauncher.enable() : appLauncher.disable(); +if ( !isDev ) { + const appLauncher = new AutoLaunch({ + name: 'Rambox' + ,isHidden: config.get('start_minimized') + }); + config.get('auto_launch') ? appLauncher.enable() : appLauncher.disable(); +} // Keep a global reference of the window object, if you don't, the window will // be closed automatically when the JavaScript object is garbage collected. @@ -320,13 +322,13 @@ if (!shouldQuit) { } app.on('second-instance', (event, commandLine, workingDirectory) => { // Someone tried to run a second instance, we should focus our window. - if (mainWindow) { - if (mainWindow.isMinimized()) mainWindow.restore(); - mainWindow.focus(); - mainWindow.show(); - mainWindow.setSkipTaskbar(false); - if (app.dock && app.dock.show) app.dock.show(); - } + if (mainWindow) { + if (mainWindow.isMinimized()) mainWindow.restore(); + mainWindow.focus(); + mainWindow.show(); + mainWindow.setSkipTaskbar(false); + if (app.dock && app.dock.show) app.dock.show(); + } });