Merge branch 'master' into feature/america

This commit is contained in:
Patrick Fic
2023-11-10 15:25:47 -08:00
23 changed files with 28571 additions and 2335 deletions

View File

@@ -12,6 +12,13 @@ export default async function FcmHandler({ client, payload }) {
},
},
});
client.cache.modify({
fields: {
messages_aggregate(cached) {
return { aggregate: { count: cached.aggregate.count + 1 } };
},
},
});
break;
case "messaging-outbound":
client.cache.modify({
@@ -30,6 +37,7 @@ export default async function FcmHandler({ client, payload }) {
});
break;
case "messaging-mark-conversation-read":
let previousUnreadCount = 0;
client.cache.modify({
id: client.cache.identify({
__typename: "conversations",
@@ -37,10 +45,22 @@ export default async function FcmHandler({ client, payload }) {
}),
fields: {
messages_aggregate(cached) {
previousUnreadCount = cached.aggregate.count;
return { aggregate: { count: 0 } };
},
},
});
client.cache.modify({
fields: {
messages_aggregate(cached) {
return {
aggregate: {
count: cached.aggregate.count - previousUnreadCount,
},
};
},
},
});
break;
default:
console.log("No payload type set.");