Merged in release/2024-11-22 (pull request #1976)
feature/IO-3000-messaging-sockets-migration2 -
This commit is contained in:
@@ -44,7 +44,6 @@ function ChatConversationContainer({ bodyshop, selectedConversation }) {
|
|||||||
|
|
||||||
messages.forEach((message) => {
|
messages.forEach((message) => {
|
||||||
const messageRef = client.cache.identify(message);
|
const messageRef = client.cache.identify(message);
|
||||||
|
|
||||||
// Write the new message to the cache
|
// Write the new message to the cache
|
||||||
client.cache.writeFragment({
|
client.cache.writeFragment({
|
||||||
id: messageRef,
|
id: messageRef,
|
||||||
@@ -72,6 +71,9 @@ function ChatConversationContainer({ bodyshop, selectedConversation }) {
|
|||||||
const alreadyExists = existingMessages.some((msg) => msg.__ref === messageRef);
|
const alreadyExists = existingMessages.some((msg) => msg.__ref === messageRef);
|
||||||
if (alreadyExists) return existingMessages;
|
if (alreadyExists) return existingMessages;
|
||||||
return [...existingMessages, { __ref: messageRef }];
|
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]
|
[client.cache]
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user