Skip to content

Commit d811e3c

Browse files
committed
🐛(frontend) table of content disappearing
The table of content was disappearing when the user was looking the version history then came back to the main document. This commit fixes this issue.
1 parent fe5fda5 commit d811e3c

File tree

3 files changed

+6
-11
lines changed

3 files changed

+6
-11
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ and this project adheres to
1616

1717
- 🧑‍💻(docker): add .next to .dockerignore #1055
1818

19+
### Fixed
20+
21+
🐛(frontend) table of content disappearing #982
22+
23+
1924
## [3.3.0] - 2025-05-06
2025

2126
### Added

src/frontend/apps/impress/src/features/docs/doc-editor/components/BlockNoteEditor.tsx

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ export const BlockNoteEditorVersion = ({
178178
initialContent,
179179
}: BlockNoteEditorVersionProps) => {
180180
const readOnly = true;
181-
const { setEditor } = useEditorStore();
182181
const editor = useCreateBlockNote(
183182
{
184183
collaboration: {
@@ -193,15 +192,6 @@ export const BlockNoteEditorVersion = ({
193192
},
194193
[initialContent],
195194
);
196-
useHeadings(editor);
197-
198-
useEffect(() => {
199-
setEditor(editor);
200-
201-
return () => {
202-
setEditor(undefined);
203-
};
204-
}, [setEditor, editor]);
205195

206196
return (
207197
<Box $css={cssEditor(readOnly)} className="--docs--editor-container">

src/frontend/apps/impress/src/features/docs/doc-editor/hook/useHeadings.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export const useHeadings = (editor: DocsBlockNoteEditor) => {
99
useEffect(() => {
1010
setHeadings(editor);
1111

12-
editor?.onEditorContentChange(() => {
12+
editor?.onChange(() => {
1313
setHeadings(editor);
1414
});
1515

0 commit comments

Comments
 (0)