🐛 Fix code in wrong place

This commit is contained in:
LittleSheep 2024-03-19 22:54:21 +08:00
parent 920492d5a6
commit 12cbb670df
2 changed files with 6 additions and 7 deletions

View File

@ -23,7 +23,10 @@
import { useRealms } from "@/stores/realms" import { useRealms } from "@/stores/realms"
import { getAtk } from "@/stores/userinfo" import { getAtk } from "@/stores/userinfo"
import { ref } from "vue" import { ref } from "vue"
import { useRoute, useRouter } from "vue-router"
const route = useRoute()
const router = useRouter()
const realms = useRealms() const realms = useRealms()
const emits = defineEmits(["relist"]) const emits = defineEmits(["relist"])
@ -48,6 +51,9 @@ async function deletePost() {
realms.show.delete = false realms.show.delete = false
realms.related.delete_to = null realms.related.delete_to = null
emits("relist") emits("relist")
if (route.name?.toString()?.startsWith("realm")) {
router.push({ name: "explore" })
}
} }
loading.value = false loading.value = false
} }

View File

@ -31,10 +31,7 @@
import { ref, watch } from "vue" import { ref, watch } from "vue"
import { getAtk } from "@/stores/userinfo" import { getAtk } from "@/stores/userinfo"
import { useRealms } from "@/stores/realms" import { useRealms } from "@/stores/realms"
import { useRoute, useRouter } from "vue-router"
const route = useRoute()
const router = useRouter()
const emits = defineEmits(["relist"]) const emits = defineEmits(["relist"])
const realms = useRealms() const realms = useRealms()
@ -76,10 +73,6 @@ async function submit(evt: SubmitEvent) {
realms.done = true realms.done = true
realms.show.editor = false realms.show.editor = false
realms.related.edit_to = null realms.related.edit_to = null
if (route.name?.toString()?.startsWith("realm")) {
router.push({ name: "explore" })
}
} }
loading.value = false loading.value = false
} }