From 5ad131c4f2fe6098751c990f3c99fe7c2abb8f06 Mon Sep 17 00:00:00 2001 From: talksik Date: Sun, 29 May 2022 11:31:22 -0500 Subject: [PATCH] smoother but not there yet --- packages/desktop/src/components/Terminal.tsx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/desktop/src/components/Terminal.tsx b/packages/desktop/src/components/Terminal.tsx index 5beeb3c..9f3de80 100644 --- a/packages/desktop/src/components/Terminal.tsx +++ b/packages/desktop/src/components/Terminal.tsx @@ -848,18 +848,16 @@ function ConversationDetails() { } }, [selectedConversation.membersInRoom]); - // update my last active date in this conversation - // put me in the membersInRoom + // put me in the membersInRoom and leave every time I change conversations useEffect(() => { - // if not already joined, will join so others have presence - if (!selectedConversation.membersInRoom.includes(user.uid)) - joinConversation(selectedConversation.id, user.uid); + joinConversation(selectedConversation.id, user.uid); return () => { leaveConversation(selectedConversation.id, user.uid); }; - }, [selectedConversation.id, selectedConversation.membersInRoom, user.uid]); + }, [selectedConversation.id, user.uid]); + // update my last active date in this conversation for this viewing session's ui useEffect(() => { setLastActiveDate((prevLastActiveForCurrentSession) => { if (prevLastActiveForCurrentSession) return prevLastActiveForCurrentSession;