refactor: ignore case when matching editor raw types (#5602)

#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.14.x

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

编辑文章匹配编辑器类型时,忽略大小写。

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

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

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

```release-note
None
```
This commit is contained in:
Ryan Wang
2024-03-27 13:00:07 +08:00
committed by GitHub
parent 1a19bdcb54
commit c2a71545aa
3 changed files with 20 additions and 17 deletions

View File

@@ -1,26 +1,26 @@
<script lang="ts" setup>
import {
Dialog,
IconBookRead,
IconEye,
IconSave,
IconSettings,
IconSendPlaneFill,
IconSettings,
Toast,
VButton,
VPageHeader,
VSpace,
Toast,
Dialog,
IconEye,
} from "@halo-dev/components";
import PostSettingModal from "./components/PostSettingModal.vue";
import type { Post, PostRequest } from "@halo-dev/api-client";
import {
computed,
type ComputedRef,
nextTick,
onMounted,
provide,
ref,
toRef,
type ComputedRef,
watch,
} from "vue";
import { apiClient } from "@/utils/api-client";
@@ -291,7 +291,8 @@ const handleFetchContent = async () => {
const provider =
preferredEditor ||
editorProviders.value.find(
(provider) => provider.rawType === data.rawType
(provider) =>
provider.rawType.toLowerCase() === data.rawType?.toLowerCase()
);
if (provider) {