mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-02-25 18:55:29 -06:00
Electron-249 - Updated API work flow
This commit is contained in:
committed by
kiranniranjan
parent
92076ce9c7
commit
ab6a4fdc6a
30
js/bringToFront.js
Normal file
30
js/bringToFront.js
Normal file
@@ -0,0 +1,30 @@
|
||||
'use strict';
|
||||
|
||||
const windowMgr = require('./windowMgr.js');
|
||||
const { getConfigField } = require('./config.js');
|
||||
const log = require('./log.js');
|
||||
const logLevels = require('./enums/logLevels.js');
|
||||
|
||||
/**
|
||||
* Method that checks if user has enabled the bring to front feature
|
||||
* if so then activates the main window
|
||||
* @param windowName - Name of the window to activate
|
||||
*/
|
||||
function bringToFront(windowName) {
|
||||
|
||||
getConfigField('bringToFront')
|
||||
.then((bringToFrontSetting) => {
|
||||
if (typeof bringToFrontSetting === 'boolean' && bringToFrontSetting) {
|
||||
log.send(logLevels.INFO, 'Window has been activated for: bringToFront');
|
||||
windowMgr.activate(windowName || 'main');
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
log.send(logLevels.ERROR, 'Could not read bringToFront field from config error= ' + error);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
module.exports = {
|
||||
bringToFront: bringToFront
|
||||
};
|
||||
Reference in New Issue
Block a user