From 648a9b8f6410f8c2a5ec96587d18d508bf0107a5 Mon Sep 17 00:00:00 2001 From: Dave Richer Date: Thu, 28 Nov 2024 12:27:06 -0800 Subject: [PATCH] feature/IO-3000-messaging-sockets-migration2 - - Small change Signed-off-by: Dave Richer --- .../chat-conversation/chat-conversation.container.jsx | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/client/src/components/chat-conversation/chat-conversation.container.jsx b/client/src/components/chat-conversation/chat-conversation.container.jsx index ffaa3d807..4a2992f6d 100644 --- a/client/src/components/chat-conversation/chat-conversation.container.jsx +++ b/client/src/components/chat-conversation/chat-conversation.container.jsx @@ -44,7 +44,6 @@ function ChatConversationContainer({ bodyshop, selectedConversation }) { messages.forEach((message) => { const messageRef = client.cache.identify(message); - // Write the new message to the cache client.cache.writeFragment({ id: messageRef, @@ -72,6 +71,9 @@ function ChatConversationContainer({ bodyshop, selectedConversation }) { const alreadyExists = existingMessages.some((msg) => msg.__ref === messageRef); if (alreadyExists) return existingMessages; return [...existingMessages, { __ref: messageRef }]; + }, + updated_at() { + return message.created_at; } } }); @@ -91,13 +93,6 @@ function ChatConversationContainer({ bodyshop, selectedConversation }) { } }); }); - - client.cache.modify({ - id: client.cache.identify({ __typename: "conversations", id: conversationId }), - fields: { - unreadcnt: () => 0 - } - }); }, [client.cache] );