fix: accept task messages in project chat panel

This commit is contained in:
Markov 2026-03-17 11:13:46 +01:00
parent 55e1c305ba
commit b402298ea2

View File

@ -67,7 +67,9 @@ export default function ChatPanel({ chatId, projectId }: Props) {
// WS: new messages // WS: new messages
useEffect(() => { useEffect(() => {
const unsub = wsClient.on("message.new", (msg: Message) => { const unsub = wsClient.on("message.new", (msg: Message) => {
if (msg.chat_id !== chatId) return; // Accept messages for this chat OR task messages from same project
if (msg.chat_id !== chatId && !msg.task_id) return;
if (msg.chat_id && msg.chat_id !== chatId) return;
setMessages((prev) => { setMessages((prev) => {
if (prev.some((m) => m.id === msg.id)) return prev; if (prev.some((m) => m.id === msg.id)) return prev;
return [...prev, msg]; return [...prev, msg];