From a61da4f65e544363f16ef2887a869cc3c1ca4904 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Tue, 19 Mar 2024 22:08:56 +0800 Subject: [PATCH] :rotating_light: Fix somewhere affected due refactored realm store --- pkg/views/src/components/publish/ArticleEditor.vue | 4 +++- pkg/views/src/components/publish/parts/PublishArea.vue | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/views/src/components/publish/ArticleEditor.vue b/pkg/views/src/components/publish/ArticleEditor.vue index c720d01..384eae2 100644 --- a/pkg/views/src/components/publish/ArticleEditor.vue +++ b/pkg/views/src/components/publish/ArticleEditor.vue @@ -121,12 +121,14 @@ import { request } from "@/scripts/request" import { useEditor } from "@/stores/editor" import { getAtk } from "@/stores/userinfo" +import { useRealms } from "@/stores/realms"; import { computed, reactive, ref, watch } from "vue"; import { useRouter } from "vue-router" import PlannedPublish from "@/components/publish/parts/PlannedPublish.vue" import Media from "@/components/publish/parts/Media.vue" import PublishArea from "@/components/publish/parts/PublishArea.vue"; +const realms = useRealms() const editor = useEditor() const dialogs = reactive({ @@ -147,7 +149,7 @@ const data = ref({ const currentRealm = computed(() => { if(data.value.realm_id) { - return editor.availableRealms.find((e) => e.id === data.value.realm_id) + return realms.available.find((e: any) => e.id === data.value.realm_id) } else { return null } diff --git a/pkg/views/src/components/publish/parts/PublishArea.vue b/pkg/views/src/components/publish/parts/PublishArea.vue index f96a85a..b4bae5e 100644 --- a/pkg/views/src/components/publish/parts/PublishArea.vue +++ b/pkg/views/src/components/publish/parts/PublishArea.vue @@ -15,7 +15,7 @@ variant="solo-filled" item-title="name" item-value="id" - :items="editor.availableRealms" + :items="realms.available" :model-value="props.value" @update:model-value="(val) => emits('update:value', val)" /> @@ -29,7 +29,9 @@