Merge remote-tracking branch 'origin/feature/IO-3000-messaging-sockets-migrationv2' into release/2024-11-22
This commit is contained in:
@@ -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]
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user