From 25dad3c90643fe7e984cedba9f9e3231db37db49 Mon Sep 17 00:00:00 2001 From: ilya-bkv Date: Thu, 15 Dec 2022 14:01:07 +0300 Subject: [PATCH] linter fix --- src/context/inbox.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/context/inbox.tsx b/src/context/inbox.tsx index 4c877285..734e66c5 100644 --- a/src/context/inbox.tsx +++ b/src/context/inbox.tsx @@ -53,10 +53,10 @@ export const InboxProvider = (props: { children: JSX.Element }) => { try { const message = await apiClient.createMessage(args) setMessages((prev) => [...prev, message]) - const chat = chats().find((chat) => chat.id === args.chat) + const currentChat = chats().find((chat) => chat.id === args.chat) setChats((prev) => [ - ...prev.filter((c) => c.id !== chat.id), - { ...chat, updatedAt: message.createdAt } + ...prev.filter((c) => c.id !== currentChat.id), + { ...currentChat, updatedAt: message.createdAt } ]) } catch (error) { console.error('[post message error]:', error)