From 60fc24cd39270994fdbec481db317b70c788ad3e Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Tue, 31 Dec 2024 19:42:49 -0800 Subject: [PATCH] refac: channel message input --- src/lib/components/channel/Channel.svelte | 2 +- src/lib/components/channel/MessageInput.svelte | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/components/channel/Channel.svelte b/src/lib/components/channel/Channel.svelte index b205afcb3..68d35a4c6 100644 --- a/src/lib/components/channel/Channel.svelte +++ b/src/lib/components/channel/Channel.svelte @@ -136,7 +136,7 @@ }; const submitHandler = async ({ content, data }) => { - if (!content) { + if (!content && (data?.files ?? []).length === 0) { return; } diff --git a/src/lib/components/channel/MessageInput.svelte b/src/lib/components/channel/MessageInput.svelte index c0605da8c..aabcb2be1 100644 --- a/src/lib/components/channel/MessageInput.svelte +++ b/src/lib/components/channel/MessageInput.svelte @@ -243,7 +243,7 @@ }; const submitHandler = async () => { - if (content === '') { + if (content === '' && files.length === 0) { return; } @@ -581,11 +581,11 @@