mirror of
https://github.com/halo-dev/halo.git
synced 2025-12-20 16:44:38 +08:00
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:
@@ -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 } =
|
||||
|
||||
Reference in New Issue
Block a user