From dae13a691beb9f30abba42a6760b4892898e466f Mon Sep 17 00:00:00 2001 From: Arjun Patel Date: Sat, 5 Feb 2022 20:07:50 -0800 Subject: [PATCH] Update conversationService.ts --- packages/common/services/conversationService.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/packages/common/services/conversationService.ts b/packages/common/services/conversationService.ts index e05859c..9426bc4 100644 --- a/packages/common/services/conversationService.ts +++ b/packages/common/services/conversationService.ts @@ -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 } + ); }); } }