electron-201: fixes issue related to auto launch

This commit is contained in:
Vishwas Shashidhar
2017-11-07 13:23:31 +05:30
parent 8fb57d2375
commit b1299a1283
2 changed files with 21 additions and 24 deletions

View File

@@ -157,9 +157,8 @@ function setupThenOpenMainWindow() {
let launchOnStartup = process.argv[3];
// We wire this in via the post install script
// to get the config file path where the app is installed
let appGlobalConfigPath = process.argv[2];
setStartup(launchOnStartup)
.then(() => updateUserConfigMac(appGlobalConfigPath))
.then(updateUserConfigMac)
.then(app.quit)
.catch(app.quit);
return;
@@ -178,18 +177,13 @@ function setupThenOpenMainWindow() {
* @returns {Promise}
*/
function setStartup(lStartup) {
return symphonyAutoLauncher.isEnabled()
.then(function(isEnabled) {
if (!isEnabled && lStartup) {
return symphonyAutoLauncher.enable();
}
if (isEnabled && !lStartup) {
return symphonyAutoLauncher.disable();
}
return true;
});
return new Promise((resolve) => {
let launchOnStartup = (lStartup === 'true');
if (launchOnStartup) {
symphonyAutoLauncher.enable();
}
return resolve();
});
}
/**