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

This is an automated cherry-pick of #904

/assign JohnNiang

```release-note
修复在新建文章时,首次切换编辑器后没有设置内容 rawType 资源为对应编辑器类型的问题。
```
pull/913/head
Halo Dev Bot 2 years ago committed by GitHub
parent 50557ce318
commit b33268997d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

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