Skip to content

Commit fd78ca3

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 09d3ff3 commit fd78ca3

File tree

3 files changed

+5
-12
lines changed

3 files changed

+5
-12
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,14 @@ and this project adheres to
2525
- ⬆️(docker) upgrade backend image to python 3.13 #973
2626
- ⬆️(docker) upgrade node images to alpine 3.21
2727

28-
2928
### Removed
3029

3130
- 🔥(back) remove footer endpoint
3231

32+
### Fixed
33+
34+
🐛(frontend) table of content disappearing #982
35+
3336
## [3.2.1] - 2025-05-06
3437

3538
## Fixed

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
@@ -176,7 +176,6 @@ export const BlockNoteEditorVersion = ({
176176
initialContent,
177177
}: BlockNoteEditorVersionProps) => {
178178
const readOnly = true;
179-
const { setEditor } = useEditorStore();
180179
const editor = useCreateBlockNote(
181180
{
182181
collaboration: {
@@ -191,15 +190,6 @@ export const BlockNoteEditorVersion = ({
191190
},
192191
[initialContent],
193192
);
194-
useHeadings(editor);
195-
196-
useEffect(() => {
197-
setEditor(editor);
198-
199-
return () => {
200-
setEditor(undefined);
201-
};
202-
}, [setEditor, editor]);
203193

204194
return (
205195
<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)