aboutsummaryrefslogtreecommitdiffstats
path: root/src/webview/spellchecker.ts
diff options
context:
space:
mode:
authorLibravatar Vijay Aravamudhan <vraravam@users.noreply.github.com>2022-04-22 15:04:21 -0500
committerLibravatar GitHub <noreply@github.com>2022-04-22 20:04:21 +0000
commit759d93dc198a3cc8c5265245c0144efa5435682b (patch)
tree53e963a085d3d12af5a2efa2f1ab6f3e5574edc7 /src/webview/spellchecker.ts
parentAdded build scripts for linux, macos and windows to help new contributors get... (diff)
downloadferdium-app-759d93dc198a3cc8c5265245c0144efa5435682b.tar.gz
ferdium-app-759d93dc198a3cc8c5265245c0144efa5435682b.tar.zst
ferdium-app-759d93dc198a3cc8c5265245c0144efa5435682b.zip
Turn off usage of 'debug' npm package using with electron-16 (fixes #17)
Diffstat (limited to 'src/webview/spellchecker.ts')
-rw-r--r--src/webview/spellchecker.ts9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/webview/spellchecker.ts b/src/webview/spellchecker.ts
index bad2bb4ff..8cf16a7ba 100644
--- a/src/webview/spellchecker.ts
+++ b/src/webview/spellchecker.ts
@@ -2,7 +2,8 @@ import { ipcRenderer } from 'electron';
2import { SPELLCHECKER_LOCALES } from '../i18n/languages'; 2import { SPELLCHECKER_LOCALES } from '../i18n/languages';
3import { isMac } from '../environment'; 3import { isMac } from '../environment';
4 4
5const debug = require('debug')('Ferdium:spellchecker'); 5// TODO: Go back to 'debug' from 'console.log' when https://github.com/electron/electron/issues/31689 is fixed
6// const debug = require('debug')('Ferdium:spellchecker');
6 7
7export function getSpellcheckerLocaleByFuzzyIdentifier(identifier: string) { 8export function getSpellcheckerLocaleByFuzzyIdentifier(identifier: string) {
8 const locales = Object.keys(SPELLCHECKER_LOCALES).filter( 9 const locales = Object.keys(SPELLCHECKER_LOCALES).filter(
@@ -16,14 +17,14 @@ export function getSpellcheckerLocaleByFuzzyIdentifier(identifier: string) {
16 17
17export function switchDict(fuzzyLocale: string, serviceId: string) { 18export function switchDict(fuzzyLocale: string, serviceId: string) {
18 if (isMac) { 19 if (isMac) {
19 debug('Ignoring dictionary changes on macOS'); 20 console.log('Ignoring dictionary changes on macOS');
20 return; 21 return;
21 } 22 }
22 23
23 debug(`Setting spellchecker locale from: ${fuzzyLocale}`); 24 console.log(`Setting spellchecker locale from: ${fuzzyLocale}`);
24 const locale = getSpellcheckerLocaleByFuzzyIdentifier(fuzzyLocale); 25 const locale = getSpellcheckerLocaleByFuzzyIdentifier(fuzzyLocale);
25 if (locale) { 26 if (locale) {
26 debug(`Sending spellcheck locales to host: ${locale}`); 27 console.log(`Sending spellcheck locales to host: ${locale}`);
27 ipcRenderer.send('set-spellchecker-locales', { locale, serviceId }); 28 ipcRenderer.send('set-spellchecker-locales', { locale, serviceId });
28 } 29 }
29} 30}