+
{shouldPreviewImage(type) ? (
converting ? (
@@ -63,7 +63,7 @@ export default function UploadFileList({ context, id }: { context: ChatContext;
getFileIcon(type, name)
)}
-
+
{name}
{formatBytes(size)}
diff --git a/src/components/Send/index.tsx b/src/components/Send/index.tsx
index 1bbe374d..e1742cae 100644
--- a/src/components/Send/index.tsx
+++ b/src/components/Send/index.tsx
@@ -13,7 +13,7 @@ import useSendMessage from "@/hooks/useSendMessage";
import useUploadFile from "@/hooks/useUploadFile";
import useUserOperation from "@/hooks/useUserOperation";
import StyledButton from "../styled/Button";
-import TextInput from "../TextInput";
+// import TextInput from "../TextInput";
import Replying from "./Replying";
import Toolbar from "./Toolbar";
import UploadFileList from "./UploadFileList";
@@ -80,22 +80,24 @@ const Send: FC = ({
}
};
const handleSendMessage = async () => {
- if (!id || !msg.text.trim()) return;
- // send text msgs
+ if (!id) return;
if (editorRef.current) {
editorRef.current.reset();
}
- const { text, mentions } = msg;
- const properties = { mentions };
- properties.local_id = +new Date();
- await sendMessage({
- id,
- reply_mid: replying_mid,
- type: "text",
- content: text,
- from_uid,
- properties
- });
+ if (msg.text.trim()) {
+ // send text msg
+ const { text, mentions } = msg;
+ const properties = { mentions };
+ properties.local_id = +new Date();
+ await sendMessage({
+ id,
+ reply_mid: replying_mid,
+ type: "text",
+ content: text,
+ from_uid,
+ properties
+ });
+ }
// send files
if (uploadFiles.length !== 0) {
uploadFiles.forEach((fileInfo) => {
@@ -154,11 +156,11 @@ const Send: FC = ({
return (
<>
{/* mobile input */}
-
+ {/* */}
{/* PC input */}