enable by default spell-check

pull/1020/head
Audric Ackermann 5 years ago
parent a314b1f3de
commit 8f01d1dbb7
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -1023,7 +1023,10 @@
};
window.toggleSpellCheck = () => {
const newValue = !window.getSettingValue('spell-check');
const currentValue = window.getSettingValue('spell-check');
// if undefined, it means 'default' so true. but we have to toggle it, so false
// if not undefined, we take the opposite
const newValue = currentValue !== undefined? !currentValue : false;
window.Events.setSpellCheck(newValue);
window.pushToast({
description: window.i18n('spellCheckDirty'),

@ -116,9 +116,8 @@ export class SettingsView extends React.Component<SettingsViewProps, State> {
const description = setting.description || '';
const comparisonValue = setting.comparisonValue || null;
const value =
window.getSettingValue(setting.id, comparisonValue) ||
(setting.content && setting.content.defaultValue);
const storedSetting = window.getSettingValue(setting.id, comparisonValue);
const value = storedSetting !== undefined ? storedSetting : setting.content && setting.content.defaultValue;
const sliderFn =
setting.type === SessionSettingType.Slider
@ -356,7 +355,7 @@ export class SettingsView extends React.Component<SettingsViewProps, State> {
type: SessionSettingType.Toggle,
category: SessionSettingCategory.Appearance,
setFn: window.toggleSpellCheck,
content: undefined,
content: { defaultValue: true },
comparisonValue: undefined,
onClick: undefined,
confirmationDialogParams: undefined,

Loading…
Cancel
Save