Update conversationService.ts

This commit is contained in:
Arjun Patel
2022-02-05 20:07:50 -08:00
parent 9a82b249ac
commit dae13a691b
@@ -129,6 +129,13 @@ export default class ConversationService {
);
const conversationDoc = doc(this.db, Collections.conversations, convoId);
const userConvoAssocDoc = doc(
this.db,
Collections.conversations,
convoId,
Collections.conversationMembers,
createdByUserId
);
await runTransaction(this.db, async (transaction) => {
// want to add to the long term collection of all audio clips for a conversation
@@ -148,6 +155,15 @@ export default class ConversationService {
},
{ merge: true }
);
// update the user's convo assoc so that their last interaction was set properly
transaction.set(
userConvoAssocDoc,
{
lastInteractionDate: serverTimestamp(),
},
{ merge: true }
);
});
}
}