From 5c480678429f84ed9c50b792e48d0cff78090e6f Mon Sep 17 00:00:00 2001 From: SlimusMinus Date: Tue, 13 Oct 2026 01:20:09 +0300 Subject: [PATCH 1/2] fix chat list image taken from the clicked card instead of the chat createOrGetChat stored the clicked card's post for the returned chat id, even when the backend returned an existing chat about another ad. The chat then showed the new ad's image until the next list fetch replaced it with the real one. The backend's chat.post is now the source of truth; card data only adds the emoji for the same ad. Also limit the chat input to 4000 characters, matching the backend. Co-Authored-By: Claude Opus 5.5 (1M context) --- src/components/chat/ChatInputBar.jsx | 4 ++++ src/hooks/useChats.js | 13 +++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/components/chat/ChatInputBar.jsx b/src/components/chat/ChatInputBar.jsx index e0e9166..82af217 100644 --- a/src/components/chat/ChatInputBar.jsx +++ b/src/components/chat/ChatInputBar.jsx @@ -1,3 +1,6 @@ +// Тот же лимит, что ChatService.MAX_MESSAGE_LENGTH на бэкенде +const MAX_MESSAGE_LENGTH = 4000; + export default function ChatInputBar({ input, onInputChange, @@ -13,6 +16,7 @@ export default function ChatInputBar({ onChange={(e) => onInputChange(e.target.value)} placeholder={placeholder} className="chat-input" + maxLength={MAX_MESSAGE_LENGTH} /> + {!isOwnAd && ( + + )} {onMarkFound && isOwner && !isClosed && (