From 09154f1359fb9468963b4bc9695159fd956ffd0e Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sun, 31 Mar 2024 20:35:36 +0800 Subject: [PATCH] :sparkles: Messages update & deletion --- src/components/chat/ChatEditor.vue | 52 +++++++++++++++++-- src/components/chat/ChatList.vue | 2 +- src/components/chat/ChatMessage.vue | 39 +++++++++++++- src/components/chat/MessageDeletion.vue | 52 +++++++++++++++++++ .../chat/channels/ChannelDeletion.vue | 8 +-- src/components/chat/channels/ChannelTools.vue | 5 ++ src/components/realms/RealmDeletion.vue | 8 +-- src/layouts/chat.vue | 21 +++++--- src/stores/channels.ts | 41 +++++++++++++-- src/views/chat/page.vue | 8 +-- 10 files changed, 209 insertions(+), 27 deletions(-) create mode 100644 src/components/chat/MessageDeletion.vue diff --git a/src/components/chat/ChatEditor.vue b/src/components/chat/ChatEditor.vue index 6899c38..20d439f 100644 --- a/src/components/chat/ChatEditor.vue +++ b/src/components/chat/ChatEditor.vue @@ -1,5 +1,33 @@ diff --git a/src/components/realms/RealmDeletion.vue b/src/components/realms/RealmDeletion.vue index 89a0c92..9a47732 100644 --- a/src/components/realms/RealmDeletion.vue +++ b/src/components/realms/RealmDeletion.vue @@ -8,7 +8,7 @@ @@ -36,7 +36,7 @@ const error = ref(null) const success = ref(false) const loading = ref(false) -async function deletePost() { +async function deleteRealm() { const target = realms.related.delete_to const url = `/api/realms/${target.id}` @@ -52,8 +52,8 @@ async function deletePost() { realms.show.delete = false realms.related.delete_to = null emits("relist") - if (route.name?.toString()?.startsWith("realm")) { - router.push({ name: "explore" }) + if (route.name?.toString()?.includes("realm")) { + await router.push({ name: "explore" }) } } loading.value = false diff --git a/src/layouts/chat.vue b/src/layouts/chat.vue index 143c6ae..8d3078b 100644 --- a/src/layouts/chat.vue +++ b/src/layouts/chat.vue @@ -1,10 +1,10 @@