aboutsummaryrefslogtreecommitdiffstats
path: root/src/index.js
diff options
context:
space:
mode:
authorLibravatar Vijay Aravamudhan <vraravam@users.noreply.github.com>2021-09-21 02:17:28 +0530
committerLibravatar GitHub <noreply@github.com>2021-09-20 22:47:28 +0200
commita40f9e8eb9e536d554b699f2dc428cc532cbc6f6 (patch)
treec13eac23445b318219e9ec73ef28702cda8864b3 /src/index.js
parent5.6.3-nightly.8 [skip ci] (diff)
downloadferdium-app-a40f9e8eb9e536d554b699f2dc428cc532cbc6f6.tar.gz
ferdium-app-a40f9e8eb9e536d554b699f2dc428cc532cbc6f6.tar.zst
ferdium-app-a40f9e8eb9e536d554b699f2dc428cc532cbc6f6.zip
remove reference to '@electron/remote' module (for spell-checker) (#1968)
* fix: remove reference to '@electron/remote' module for spell-checker * chore: removed redundant methods from being exposed via 'window.ferdi' to the recipes
Diffstat (limited to 'src/index.js')
-rw-r--r--src/index.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/index.js b/src/index.js
index 758b11dc9..97a4f0379 100644
--- a/src/index.js
+++ b/src/index.js
@@ -550,6 +550,20 @@ ipcMain.on('stop-find-in-page', (e, action) => {
550 e.returnValue = null; 550 e.returnValue = null;
551}); 551});
552 552
553ipcMain.on('set-spellchecker-locales', (e, { locale, serviceId }) => {
554 if (serviceId === undefined) {
555 return;
556 }
557
558 const serviceSession = session.fromPartition(`persist:service-${serviceId}`);
559 const [defaultLocale] = serviceSession.getSpellCheckerLanguages();
560 debug(`Spellchecker default locale is: ${defaultLocale}`);
561
562 const locales = [locale, defaultLocale, DEFAULT_APP_SETTINGS.fallbackLocale];
563 debug(`Setting spellchecker locales to: ${locales}`);
564 serviceSession.setSpellCheckerLanguages(locales);
565});
566
553// Quit when all windows are closed. 567// Quit when all windows are closed.
554app.on('window-all-closed', () => { 568app.on('window-all-closed', () => {
555 // On OS X it is common for applications and their menu bar 569 // On OS X it is common for applications and their menu bar