Reenable basic spellchecking

This commit is contained in:
Janosch Maier 2021-11-24 23:45:10 +01:00 committed by Ben Gotow
parent a9b73e0b91
commit 9c04a40782

View file

@ -119,15 +119,13 @@ class Spellchecker {
}; };
isMisspelled = (word: string) => { isMisspelled = (word: string) => {
/*
if (!this.handler) {
return false;
}
if ({}.hasOwnProperty.call(this._customDict, word)) { if ({}.hasOwnProperty.call(this._customDict, word)) {
return false; return false;
} }
return !(this.handler as any).handleElectronSpellCheck([word]);
*/ return webFrame.isWordMisspelled(word)
}; };
learnWord = word => { learnWord = word => {
@ -147,14 +145,9 @@ class Spellchecker {
}; };
appendSpellingItemsToMenu = async ({ menu, word, onCorrect, onDidLearn }) => { appendSpellingItemsToMenu = async ({ menu, word, onCorrect, onDidLearn }) => {
//console.log(this._win.webContents.session.availableSpellCheckerLanguages);
// TODO: Re-Add Spellchecking
//console.log(webFrame.isWordMisspelled(word));
//console.log(webFrame.getWordSuggestions(word));
/*
if (this.isMisspelled(word)) { if (this.isMisspelled(word)) {
const corrections = await this.handler.currentSpellchecker.getCorrectionsForMisspelling(word); const corrections = webFrame.getWordSuggestions(word);
if (corrections.length > 0) { if (corrections.length > 0) {
corrections.forEach(correction => { corrections.forEach(correction => {
menu.append( menu.append(
@ -183,7 +176,7 @@ class Spellchecker {
menu.append(new MenuItem({ type: 'separator' })); menu.append(new MenuItem({ type: 'separator' }));
} }
}; };
*/
} }
export default new Spellchecker(); export default new Spellchecker();