Commit Graph

8 Commits

Author SHA1 Message Date
SlimusMinus
08f3a7e2bb open a draft chat and create it on the first message
"Написать" now looks up an existing chat for the ad (GET, never creates).
If there is none it opens /chats/new as a draft with the ad in the header;
the first send calls POST /chats/with/{userId}/messages, which creates the
chat with that message, and the page switches to /chats/{id}. Reloading
/chats/new without draft data goes back to the chat list.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-13 01:45:21 +03:00
SlimusMinus
46f546c293 hide "write" button on own ads, log chat creation errors
The feed card showed the contact button on the user's own ads (isOwner is
false in the main feed), and the backend rejects a chat with yourself
with 400. The button is now hidden when ad.userId is the current user,
and createOrGetChat logs the backend error message.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-13 01:31:36 +03:00
SlimusMinus
5c48067842 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) <noreply@anthropic.com>
2026-10-13 01:23:12 +03:00
SlimusMinus
1aeda90da1 added timezone and fix chat 2026-10-11 23:29:27 +03:00
SlimusMinus
d94a6782a4 fix bug and errors 2026-10-06 01:00:10 +03:00
SlimusMinus
7f59ee1f38 fixed code 2026-08-11 00:24:07 +03:00
SlimusMinus
abbcc330e7 added refresh token 2026-08-03 02:44:57 +03:00
SlimusMinus
b924bc5f94 added files in git 2026-07-03 00:04:56 +03:00