diff --git a/ux/src/components/EditorWysiwyg.vue b/ux/src/components/EditorWysiwyg.vue index b4c14aed..8e4b0297 100644 --- a/ux/src/components/EditorWysiwyg.vue +++ b/ux/src/components/EditorWysiwyg.vue @@ -702,6 +702,11 @@ function init () { if (html) { console.info('[Collab] Y.Doc empty, inserting page content:', html.length, 'chars') editor.value.commands.setContent(html) + // Update page store so save works + pageStore.$patch({ + content: JSON.stringify(editor.value.getJSON()), + render: editor.value.getHTML() + }) } } }, @@ -766,6 +771,15 @@ function init () { TextStyle, Typography ], + onCreate: ({ editor }) => { + // Ensure content is populated on editor creation + if (editor && !editor.isEmpty) { + pageStore.$patch({ + content: JSON.stringify(editor.getJSON()), + render: editor.getHTML() + }) + } + }, onUpdate: ({ editor }) => { editorStore.$patch({ lastChangeTimestamp: DateTime.utc()