fix(settings): re-add spellcheck setting

This was included in the old editor preferences dialog,
which got removed altogether with the document-bar.

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
This commit is contained in:
Erik Michelson 2023-10-13 18:35:24 +02:00
parent 4775622f19
commit 3bc9708871
6 changed files with 40 additions and 35 deletions

View file

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
* SPDX-FileCopyrightText: 2023 The HedgeDoc developers (see AUTHORS file)
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
@ -9,7 +9,8 @@ import type {
SetEditorLigaturesAction,
SetEditorLineWrappingAction,
SetEditorSmartPasteAction,
SetEditorSyncScrollAction
SetEditorSyncScrollAction,
SetEditorSpellCheckAction
} from './types'
import { EditorConfigActionType } from './types'
@ -45,6 +46,14 @@ export const setEditorSmartPaste = (smartPaste: boolean): void => {
store.dispatch(action)
}
export const setEditorSpellCheck = (spellCheck: boolean): void => {
const action: SetEditorSpellCheckAction = {
type: EditorConfigActionType.SET_SPELL_CHECK,
spellCheck
}
store.dispatch(action)
}
export const loadFromLocalStorage = (): void => {
const action: LoadFromLocalStorageAction = {
type: EditorConfigActionType.LOAD_FROM_LOCAL_STORAGE

View file

@ -14,7 +14,7 @@ export const initialState: EditorConfig = {
ligatures: true,
syncScroll: true,
smartPaste: true,
spellCheck: false,
spellCheck: true,
lineWrapping: true
}

View file

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
* SPDX-FileCopyrightText: 2023 The HedgeDoc developers (see AUTHORS file)
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
@ -28,7 +28,7 @@ export type EditorConfigActions =
| SetEditorLigaturesAction
| SetEditorSmartPasteAction
| SetEditorLineWrappingAction
| SetSpellCheckAction
| SetEditorSpellCheckAction
| LoadFromLocalStorageAction
export interface LoadFromLocalStorageAction extends Action<EditorConfigActionType> {
@ -55,7 +55,7 @@ export interface SetEditorSmartPasteAction extends Action<EditorConfigActionType
smartPaste: boolean
}
export interface SetSpellCheckAction extends Action<EditorConfigActionType> {
export interface SetEditorSpellCheckAction extends Action<EditorConfigActionType> {
type: EditorConfigActionType.SET_SPELL_CHECK
spellCheck: boolean
}