mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-02-25 18:55:29 -06:00
ELECTRON-1170 - Require electron-spellchecker when web contents load
This commit is contained in:
parent
36b371eb10
commit
2523241353
10
js/main.js
10
js/main.js
@ -53,8 +53,8 @@ require('./memoryMonitor.js');
|
||||
app.setAsDefaultProtocolClient('symphony');
|
||||
|
||||
const windowMgr = require('./windowMgr.js');
|
||||
const { ContextMenuBuilder } = require('electron-spellchecker');
|
||||
const i18n = require('./translation/i18n');
|
||||
let ContextMenuBuilder;
|
||||
|
||||
getConfigField('url')
|
||||
.then(initializeCrashReporter)
|
||||
@ -247,6 +247,12 @@ app.on('web-contents-created', function (event, webContents) {
|
||||
});
|
||||
|
||||
function onWebContent(webContents) {
|
||||
|
||||
if (!ContextMenuBuilder) {
|
||||
// eslint-disable-next-line global-require
|
||||
ContextMenuBuilder = require('electron-spellchecker').ContextMenuBuilder;
|
||||
}
|
||||
|
||||
const spellchecker = windowMgr.getSpellchecker();
|
||||
spellchecker.initializeSpellChecker();
|
||||
spellchecker.updateContextMenuLocale(i18n.getMessageFor('ContextMenu'));
|
||||
@ -470,4 +476,4 @@ const handlePowerEvents = () => {
|
||||
log.send(logLevels.INFO, `Power Monitor Event Occurred: ${appEvent}`)
|
||||
});
|
||||
});
|
||||
};
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user