Skip to content

Commit

Permalink
fix: Fix issue where service can't be initialized when spellchecking …
Browse files Browse the repository at this point in the history
…language is not set
  • Loading branch information
adlk committed Aug 18, 2023
1 parent 917093e commit c089cd7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/models/ServiceBrowserView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
} from 'electron';
import ms from 'ms';
import { TAB_BAR_WIDTH, TODOS_RECIPE_ID } from '../config';
import { DEFAULT_APP_SETTINGS_VANILLA } from '../configVanilla';
import { buildMenuTpl } from '../electron/serviceContextMenuTemplate';
import Settings from '../electron/Settings';
import { isMac } from '../environment';
Expand Down Expand Up @@ -301,8 +302,13 @@ export class ServiceBrowserView {
...state,
};

const { isSpellcheckerEnabled, spellcheckerLanguage } = this.state;

this.webContents.session.setSpellCheckerEnabled(this.state.isSpellcheckerEnabled);
this.webContents.session.setSpellCheckerLanguages([this.state.spellcheckerLanguage]);

if (isSpellcheckerEnabled) {
this.webContents.session.setSpellCheckerLanguages([spellcheckerLanguage || DEFAULT_APP_SETTINGS_VANILLA.spellcheckerLanguage]);
}
}

remove() {
Expand Down

0 comments on commit c089cd7

Please sign in to comment.