🚨 Fix somewhere affected due refactored realm store

This commit is contained in:
LittleSheep 2024-03-19 22:08:56 +08:00
parent c14d3f70a3
commit a61da4f65e
2 changed files with 6 additions and 2 deletions

View File

@ -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<any>({
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
}

View File

@ -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 @@
<script setup lang="ts">
import { useEditor } from "@/stores/editor";
import { useRealms } from "@/stores/realms";
const realms = useRealms();
const editor = useEditor();
const props = defineProps<{ show: boolean; value: string | null }>();