From bbe6dbb2ca6d3783929991d4d853eefc684e2fde Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sat, 6 Apr 2024 23:45:24 +0800 Subject: [PATCH] :sparkles: Support only attachments messages and markdown messages --- src/components/chat/ChatEditor.vue | 2 +- src/components/chat/ChatMessage.vue | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/components/chat/ChatEditor.vue b/src/components/chat/ChatEditor.vue index 41bbf30..d19d541 100644 --- a/src/components/chat/ChatEditor.vue +++ b/src/components/chat/ChatEditor.vue @@ -135,7 +135,7 @@ const data = ref({ }) async function sendMessage() { - if (!data.value.content) return + if (!data.value.content && !data.value.attachments) return const url = channels.related.messages.edit_to ? `/api/channels/${channels.current.alias}/messages/${channels.related.messages.edit_to?.id}` diff --git a/src/components/chat/ChatMessage.vue b/src/components/chat/ChatMessage.vue index 207b8e1..7e59e5c 100644 --- a/src/components/chat/ChatMessage.vue +++ b/src/components/chat/ChatMessage.vue @@ -24,7 +24,12 @@ {{ createdAt }} #{{ props.item?.id }} -
{{ props.item?.content }}
+ +
+ +