diff --git a/web/src/pages/TemplateEditor.tsx b/web/src/pages/TemplateEditor.tsx index 2da8808..54c5b8b 100644 --- a/web/src/pages/TemplateEditor.tsx +++ b/web/src/pages/TemplateEditor.tsx @@ -337,11 +337,10 @@ export default function TemplateEditor() { )} { - handleEditorInit(null, editor); - if (htmlContent) editor.setContent(htmlContent); - }} + initialValue={htmlContent} + onInit={handleEditorInit} init={{ height: "100%", menubar: true, @@ -355,11 +354,7 @@ export default function TemplateEditor() { toolbar: "undo redo | blocks | bold italic forecolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | removeformat | help", content_style: "body { font-family: Arial, sans-serif; font-size: 14px; }", - setup: (editor) => { - editor.on("init", () => { - handleEditorInit(null, editor); - }); - }, + }} }} />