From 50557ce3188161db45ce28b92a4babb2a75cf36f Mon Sep 17 00:00:00 2001 From: Halo Dev Bot <87291978+halo-dev-bot@users.noreply.github.com> Date: Wed, 15 Mar 2023 11:40:26 +0800 Subject: [PATCH] [release-2.3] fix: the issue of blank content when opening a saved post in StackEdit editor plugin for editing (#905) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is an automated cherry-pick of #903 /assign JohnNiang ```release-note 修复 Console 端在使用三方编辑器插件编辑文章时可能出现无法加载内容的问题。 ``` --- src/modules/contents/pages/SinglePageEditor.vue | 4 ++-- src/modules/contents/posts/PostEditor.vue | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modules/contents/pages/SinglePageEditor.vue b/src/modules/contents/pages/SinglePageEditor.vue index 9881ed63..410bf04e 100644 --- a/src/modules/contents/pages/SinglePageEditor.vue +++ b/src/modules/contents/pages/SinglePageEditor.vue @@ -208,6 +208,8 @@ const handleFetchContent = async () => { name: formState.value.page.metadata.name, }); + formState.value.content = Object.assign(formState.value.content, data); + // get editor provider if (!currentEditorProvider.value) { const preferredEditor = editorProviders.value.find( @@ -249,8 +251,6 @@ const handleFetchContent = async () => { } await nextTick(); } - - formState.value.content = Object.assign(formState.value.content, data); }; // SinglePage settings diff --git a/src/modules/contents/posts/PostEditor.vue b/src/modules/contents/posts/PostEditor.vue index ca3812d5..1398d1eb 100644 --- a/src/modules/contents/posts/PostEditor.vue +++ b/src/modules/contents/posts/PostEditor.vue @@ -213,6 +213,8 @@ const handleFetchContent = async () => { name: formState.value.post.metadata.name, }); + formState.value.content = Object.assign(formState.value.content, data); + // get editor provider if (!currentEditorProvider.value) { const preferredEditor = editorProviders.value.find( @@ -256,8 +258,6 @@ const handleFetchContent = async () => { await nextTick(); } - - formState.value.content = Object.assign(formState.value.content, data); }; const handleOpenSettingModal = async () => {