From 0f574475a7a3d1b2385fe270c4914812568c55f4 Mon Sep 17 00:00:00 2001 From: Arjun Patel Date: Sat, 5 Feb 2022 13:35:16 -0800 Subject: [PATCH] cleaning things up for making it work with moving things from done --- .../components/MainTabsOrPages/Sidebar.tsx | 2 +- packages/web/recoil/main.tsx | 25 +++++++++++-------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/packages/web/components/MainTabsOrPages/Sidebar.tsx b/packages/web/components/MainTabsOrPages/Sidebar.tsx index 6af2692..4226aff 100644 --- a/packages/web/components/MainTabsOrPages/Sidebar.tsx +++ b/packages/web/components/MainTabsOrPages/Sidebar.tsx @@ -193,7 +193,7 @@ function Sidebar() { Priority - + {/* */} {/* list of pinned convos */} diff --git a/packages/web/recoil/main.tsx b/packages/web/recoil/main.tsx index f0ce3e1..9fd1cea 100644 --- a/packages/web/recoil/main.tsx +++ b/packages/web/recoil/main.tsx @@ -177,20 +177,23 @@ export const doneConvosSelector = selector({ // if convo lastActivityDate > lastInteractionDate // move to default/inbox convos const userConvoAssoc = convoUserMap.get(conv.id); - if ( - userConvoAssoc?.lastInteractionDate && - conv.lastActivityDate > userConvoAssoc?.lastInteractionDate - ) { - conversationService.updateUserConvoRelationship( - userConvoAssoc.id, - conv.id, - ConversationMemberState.default, - false - ); - } // get the userconvoAssoc and see the state if (userConvoAssoc?.state == ConversationMemberState.done) { + if ( + userConvoAssoc?.lastInteractionDate && + conv.lastActivityDate > userConvoAssoc?.lastInteractionDate + ) { + conversationService.updateUserConvoRelationship( + userConvoAssoc.id, + conv.id, + ConversationMemberState.default, + false + ); + + return false; + } + return true; }