mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-02-25 18:55:29 -06:00
Merge pull request #226 from VishwasShashidhar/electron-201
Electron 201: auto launch fixes
This commit is contained in:
24
js/main.js
24
js/main.js
@@ -180,9 +180,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;
|
||||
@@ -201,18 +200,15 @@ 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();
|
||||
}
|
||||
symphonyAutoLauncher.disable();
|
||||
return resolve();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user