Browse Source

[release-2.1] fix: the rawType of Content was not updated when switching editors (#910)

This is an automated cherry-pick of #904

/assign JohnNiang

```release-note
修复在新建文章时,首次切换编辑器后没有设置内容 rawType 资源为对应编辑器类型的问题。
```
release-2.1
Halo Dev Bot 2 years ago committed by GitHub
parent
commit
f490582bc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      src/modules/contents/pages/SinglePageEditor.vue
  2. 1
      src/modules/contents/posts/PostEditor.vue

1
src/modules/contents/pages/SinglePageEditor.vue

@ -48,6 +48,7 @@ const handleChangeEditorProvider = (provider: EditorProvider) => {
formState.value.page.metadata.annotations = { formState.value.page.metadata.annotations = {
"content.halo.run/preferred-editor": provider.name, "content.halo.run/preferred-editor": provider.name,
}; };
formState.value.content.rawType = provider.rawType;
}; };
// SinglePage form // SinglePage form

1
src/modules/contents/posts/PostEditor.vue

@ -48,6 +48,7 @@ const handleChangeEditorProvider = (provider: EditorProvider) => {
formState.value.post.metadata.annotations = { formState.value.post.metadata.annotations = {
"content.halo.run/preferred-editor": provider.name, "content.halo.run/preferred-editor": provider.name,
}; };
formState.value.content.rawType = provider.rawType;
}; };
// Post form // Post form

Loading…
Cancel
Save