revert: strict chat_id filter in ChatPanel

This commit is contained in:
Markov 2026-03-17 11:24:38 +01:00
parent b402298ea2
commit 2164c2e1c5

View File

@ -67,9 +67,7 @@ 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) => {
// Accept messages for this chat OR task messages from same project if (msg.chat_id !== chatId) return;
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];