From e10b43bddb9ab83f8c40b70209cb3d54ce67a43f Mon Sep 17 00:00:00 2001 From: lnn0q Date: Sun, 1 Jun 2025 22:47:39 +0300 Subject: [PATCH] chapter update fix --- app/client/components/BookChapterForm.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/client/components/BookChapterForm.tsx b/app/client/components/BookChapterForm.tsx index e8890e8..c3934ca 100644 --- a/app/client/components/BookChapterForm.tsx +++ b/app/client/components/BookChapterForm.tsx @@ -38,7 +38,14 @@ export function BookChapterForm({ readonly initialValues?: BookChapterEditInitialValues | null; readonly onChapterSubmit: (chapter: BookChapterInput) => Promise; }) { - const [content, setContent] = useState([]); + const [content, setContent] = useState( + initialValues?.content ?? [ + { + type: 'paragraph', + children: [{ text: '' }] + } + ] + ); const schema = v.pipe( v.object({