IO-1551 Include outbound fcm to update timestamps.

This commit is contained in:
Patrick Fic
2021-12-13 12:58:56 -08:00
parent 3b756beba6
commit 28cc092bb7
4 changed files with 31 additions and 4 deletions

View File

@@ -55,6 +55,7 @@ function ChatSendMessageComponent({
messagingServiceSid: bodyshop.messagingservicesid,
conversationid: conversation.id,
selectedMedia: selectedImages,
imexshopid: bodyshop.imexshopid,
});
setSelectedMedia(
selectedMedia.map((i) => {

View File

@@ -14,6 +14,22 @@ export default async function FcmHandler({ client, payload }) {
},
});
break;
case "messaging-outbound":
client.cache.modify({
id: client.cache.identify({
__typename: "conversations",
id: payload.conversationid,
}),
fields: {
updated_at(oldupdated0) {
return new Date();
},
messages_aggregate(cached) {
return { aggregate: { count: cached.aggregate.count + 1 } };
},
},
});
break;
case "messaging-mark-conversation-read":
client.cache.modify({
id: client.cache.identify({