revert: strict chat_id filter in ChatPanel
This commit is contained in:
parent
b402298ea2
commit
2164c2e1c5
@ -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];
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user