From 3def3285980e19b9c57435a4011703fda1abc580 Mon Sep 17 00:00:00 2001 From: Untone Date: Sun, 31 Dec 2023 08:06:14 +0300 Subject: [PATCH] inbox-fix --- src/components/Views/Inbox.tsx | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/components/Views/Inbox.tsx b/src/components/Views/Inbox.tsx index 65c82656..f4a79151 100644 --- a/src/components/Views/Inbox.tsx +++ b/src/components/Views/Inbox.tsx @@ -91,18 +91,10 @@ export const InboxView = (props: Props) => { } } - onMount(async () => { - try { - const response = await loadRecipients() // time ago in seconds - setRecipients(response as unknown as Author[]) - } catch (error) { - console.log(error) - } - await loadChats() - }) + onMount(loadChats) const handleSubmit = async (message: string) => { - await sendMessage({ + sendMessage({ body: message, chat_id: currentDialog()?.id.toString(), reply_to: messageToReply()?.id, @@ -149,8 +141,8 @@ export const InboxView = (props: Props) => { } } - const findToReply = (messageId) => { - return messages().find((message) => message.id === messageId) + const findToReply = (messageId: number) => { + return messages().find((message: MessageType) => message.id === messageId) } createEffect(