Update conversationService.ts
This commit is contained in:
@@ -129,6 +129,13 @@ export default class ConversationService {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const conversationDoc = doc(this.db, Collections.conversations, convoId);
|
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) => {
|
await runTransaction(this.db, async (transaction) => {
|
||||||
// want to add to the long term collection of all audio clips for a conversation
|
// 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 }
|
{ merge: true }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// update the user's convo assoc so that their last interaction was set properly
|
||||||
|
transaction.set(
|
||||||
|
userConvoAssocDoc,
|
||||||
|
{
|
||||||
|
lastInteractionDate: serverTimestamp(),
|
||||||
|
},
|
||||||
|
{ merge: true }
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user