diff --git a/CHANGELOG.md b/CHANGELOG.md index e085f692..470cfa52 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,11 @@ and this project adheres to - 🧑‍💻(docker): add .next to .dockerignore #1055 +### Fixed + +🐛(frontend) table of content disappearing #982 + + ## [3.3.0] - 2025-05-06 ### Added diff --git a/src/frontend/apps/impress/src/features/docs/doc-editor/components/BlockNoteEditor.tsx b/src/frontend/apps/impress/src/features/docs/doc-editor/components/BlockNoteEditor.tsx index 7ed06af1..9a486b58 100644 --- a/src/frontend/apps/impress/src/features/docs/doc-editor/components/BlockNoteEditor.tsx +++ b/src/frontend/apps/impress/src/features/docs/doc-editor/components/BlockNoteEditor.tsx @@ -178,7 +178,6 @@ export const BlockNoteEditorVersion = ({ initialContent, }: BlockNoteEditorVersionProps) => { const readOnly = true; - const { setEditor } = useEditorStore(); const editor = useCreateBlockNote( { collaboration: { @@ -193,15 +192,6 @@ export const BlockNoteEditorVersion = ({ }, [initialContent], ); - useHeadings(editor); - - useEffect(() => { - setEditor(editor); - - return () => { - setEditor(undefined); - }; - }, [setEditor, editor]); return ( diff --git a/src/frontend/apps/impress/src/features/docs/doc-editor/hook/useHeadings.tsx b/src/frontend/apps/impress/src/features/docs/doc-editor/hook/useHeadings.tsx index 8b88eb3d..2fbad06c 100644 --- a/src/frontend/apps/impress/src/features/docs/doc-editor/hook/useHeadings.tsx +++ b/src/frontend/apps/impress/src/features/docs/doc-editor/hook/useHeadings.tsx @@ -9,7 +9,7 @@ export const useHeadings = (editor: DocsBlockNoteEditor) => { useEffect(() => { setHeadings(editor); - editor?.onEditorContentChange(() => { + editor?.onChange(() => { setHeadings(editor); });