fixes #586
This commit is contained in:
2023-06-26 12:29:12 +01:00
parent 7c1d5273fc
commit 379bce6f9e
9 changed files with 43 additions and 50 deletions

View File

@ -7,9 +7,9 @@ import useFileUpload from "Upload";
import { openFile } from "SnortUtils";
import Textarea from "./Textarea";
import { System } from "index";
import { useChatSystem } from "chat";
import { Chat } from "chat";
export default function WriteMessage({ chatId }: { chatId: string }) {
export default function WriteMessage({ chat }: { chat: Chat }) {
const [msg, setMsg] = useState("");
const [sending, setSending] = useState(false);
const [uploading, setUploading] = useState(false);
@ -17,7 +17,6 @@ export default function WriteMessage({ chatId }: { chatId: string }) {
const [error, setError] = useState("");
const publisher = useEventPublisher();
const uploader = useFileUpload();
const chat = useChatSystem().find(a => a.id === chatId);
async function attachFile() {
try {