From 90f40276a00bebc5df800345ce54200172d5459c Mon Sep 17 00:00:00 2001 From: "Gabriel Mowses (Mouse)" Date: Thu, 2 Apr 2026 16:18:44 -0300 Subject: [PATCH] fix: ensure pageStore.content is populated on editor create and collab sync --- ux/src/components/EditorWysiwyg.vue | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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()