mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-02-25 18:55:29 -06:00
Merge branch 'master' into electron-201
This commit is contained in:
17
js/main.js
17
js/main.js
@@ -11,6 +11,7 @@ const urlParser = require('url');
|
||||
|
||||
// Local Dependencies
|
||||
const {getConfigField, updateUserConfigWin, updateUserConfigMac} = require('./config.js');
|
||||
const {setCheckboxValues} = require('./menus/menuTemplate.js');
|
||||
const { isMac, isDevEnv } = require('./utils/misc.js');
|
||||
const protocolHandler = require('./protocolHandler');
|
||||
const getCmdLineArg = require('./utils/getCmdLineArg.js');
|
||||
@@ -92,7 +93,7 @@ if (isMac) {
|
||||
* initialization and is ready to create browser windows.
|
||||
* Some APIs can only be used after this event occurs.
|
||||
*/
|
||||
app.on('ready', setupThenOpenMainWindow);
|
||||
app.on('ready', readConfigThenOpenMainWindow);
|
||||
|
||||
/**
|
||||
* Is triggered when all the windows are closed
|
||||
@@ -127,6 +128,20 @@ app.on('open-url', function(event, url) {
|
||||
handleProtocolAction(url);
|
||||
});
|
||||
|
||||
/**
|
||||
* Reads the config fields that are required for the menu items
|
||||
* then opens the main window
|
||||
*
|
||||
* This is a workaround for the issue where the menu template was returned
|
||||
* even before the config data was populated
|
||||
* https://perzoinc.atlassian.net/browse/ELECTRON-154
|
||||
*/
|
||||
function readConfigThenOpenMainWindow() {
|
||||
setCheckboxValues()
|
||||
.then(setupThenOpenMainWindow)
|
||||
.catch(setupThenOpenMainWindow)
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets up the app (to handle various things like config changes, protocol handling etc.)
|
||||
* and opens the main window
|
||||
|
||||
Reference in New Issue
Block a user