fix: not remembering the selected editor (#6114)

#### What type of PR is this?

/area ui
/kind bug
/milestone 2.17.x

#### What this PR does / why we need it:

修复新建文章时,没有自动选择之前所选编辑器的问题。

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/6091

#### Special notes for your reviewer:

#### Does this PR introduce a user-facing change?

```release-note
修复新建文章时,没有自动选择之前所选编辑器的问题。
```
This commit is contained in:
Ryan Wang
2024-06-23 11:46:29 +08:00
committed by GitHub
parent c10862d6fe
commit 373229e9de
5 changed files with 21 additions and 11 deletions

View File

@@ -50,7 +50,7 @@ const { mutateAsync: postUpdateMutate } = usePostUpdateMutate();
const { currentUserHasPermission } = usePermission();
// Editor providers
const { editorProviders } = useEditorExtensionPoints();
const { editorProviders, fetchEditorProviders } = useEditorExtensionPoints();
const currentEditorProvider = ref<EditorProvider>();
const storedEditorProviderName = useLocalStorage("editor-provider-name", "");
@@ -356,6 +356,8 @@ const onSettingPublished = (post: Post) => {
// Get post data when the route contains the name parameter
const name = useRouteQuery<string>("name");
onMounted(async () => {
await fetchEditorProviders();
if (name.value) {
// fetch post
const { data: post } =