electron-158: added logic to disable spellchecker

This commit is contained in:
Vishwas Shashidhar 2017-09-27 19:46:02 +05:30
parent 1a312544d7
commit 7985b68dfd
2 changed files with 20 additions and 14 deletions

View File

@ -26,20 +26,27 @@ require('../downloadManager');
// so loading the spellchecker in try catch so that we don't
// block other method from loading
document.addEventListener('DOMContentLoaded', () => {
try {
/* eslint-disable global-require */
const SpellCheckerHelper = require('../spellChecker').SpellCheckHelper;
/* eslint-enable global-require */
// Method to initialize spell checker
const spellChecker = new SpellCheckerHelper();
spellChecker.initializeSpellChecker();
} catch (err) {
/* eslint-disable no-console */
console.error('unable to load the spell checker module, hence, skipping the spell check feature ' + err);
/* eslint-enable no-console */
}
//loadSpellChecker();
});
/**
* Loads up the spell checker module
*/
// function loadSpellChecker() {
// try {
// /* eslint-disable global-require */
// const SpellCheckerHelper = require('../spellChecker').SpellCheckHelper;
// /* eslint-enable global-require */
// // Method to initialize spell checker
// const spellChecker = new SpellCheckerHelper();
// spellChecker.initializeSpellChecker();
// } catch (err) {
// /* eslint-disable no-console */
// console.error('unable to load the spell checker module, hence, skipping the spell check feature ' + err);
// /* eslint-enable no-console */
// }
// }
// hold ref so doesn't get GC'ed
const local = {
ipcRenderer: ipcRenderer

View File

@ -98,8 +98,7 @@
"async.mapseries": "^0.5.2",
"auto-launch": "^5.0.1",
"electron-dl": "^1.9.0",
"electron-log": "^2.2.7",
"electron-spellchecker": "^1.2.0",
"electron-log": "^2.2.7",
"electron-squirrel-startup": "^1.0.0",
"filesize": "^3.5.10",
"keymirror": "0.1.1",