[release-2.3] fix: the issue of blank content when opening a saved post in StackEdit editor plugin for editing (#905)

This is an automated cherry-pick of #903

/assign JohnNiang

```release-note
修复 Console 端在使用三方编辑器插件编辑文章时可能出现无法加载内容的问题。
```
pull/911/head
Halo Dev Bot 2 years ago committed by GitHub
parent 764326e42b
commit 50557ce318
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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

@ -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 () => {

Loading…
Cancel
Save