Browse Source

Prevent execute AutoLaunch on dev

pull/2195/head
Ramiro Saenz 6 years ago
parent
commit
f0159e3c02
  1. 26
      electron/main.js

26
electron/main.js

@ -66,11 +66,13 @@ app.setAppUserModelId('com.grupovrs.ramboxce');
const appMenu = require('./menu')(config); const appMenu = require('./menu')(config);
// Configure AutoLaunch // Configure AutoLaunch
const appLauncher = new AutoLaunch({ if ( !isDev ) {
name: 'Rambox' const appLauncher = new AutoLaunch({
,isHidden: config.get('start_minimized') name: 'Rambox'
}); ,isHidden: config.get('start_minimized')
config.get('auto_launch') && !isDev ? appLauncher.enable() : appLauncher.disable(); });
config.get('auto_launch') ? appLauncher.enable() : appLauncher.disable();
}
// Keep a global reference of the window object, if you don't, the window will // 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. // be closed automatically when the JavaScript object is garbage collected.
@ -320,13 +322,13 @@ if (!shouldQuit) {
} }
app.on('second-instance', (event, commandLine, workingDirectory) => { app.on('second-instance', (event, commandLine, workingDirectory) => {
// Someone tried to run a second instance, we should focus our window. // Someone tried to run a second instance, we should focus our window.
if (mainWindow) { if (mainWindow) {
if (mainWindow.isMinimized()) mainWindow.restore(); if (mainWindow.isMinimized()) mainWindow.restore();
mainWindow.focus(); mainWindow.focus();
mainWindow.show(); mainWindow.show();
mainWindow.setSkipTaskbar(false); mainWindow.setSkipTaskbar(false);
if (app.dock && app.dock.show) app.dock.show(); if (app.dock && app.dock.show) app.dock.show();
} }
}); });

Loading…
Cancel
Save