enable by default spell-check

pull/1020/head
Audric Ackermann 6 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 = () => { 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.Events.setSpellCheck(newValue);
window.pushToast({ window.pushToast({
description: window.i18n('spellCheckDirty'), description: window.i18n('spellCheckDirty'),

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

Loading…
Cancel
Save