From dc238a70789d8c06d067675e221501c23a52659d Mon Sep 17 00:00:00 2001 From: Lei OT Date: Thu, 22 Feb 2024 17:00:42 +0800 Subject: [PATCH] # --- src/views/Conversations/Components/ConversationsList.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/views/Conversations/Components/ConversationsList.jsx b/src/views/Conversations/Components/ConversationsList.jsx index a778263..15040e7 100644 --- a/src/views/Conversations/Components/ConversationsList.jsx +++ b/src/views/Conversations/Components/ConversationsList.jsx @@ -74,6 +74,7 @@ const Conversations = () => { return () => {}; }, [conversationsList, currentConversation]); + const [switchToC, setSwitchToC] = useState({}); const [shouldFetchCList, setShouldFetchCList] = useState(true); useEffect(() => { if (order_sn && shouldFetchCList && initialState) { @@ -116,12 +117,11 @@ const Conversations = () => { setCurrentConversation(item); }; - const [switchToC, setSwitchToC] = useState({}); const onSwitchConversation = (item) => { - if (item.coli_sn) { - navigate(`/order/chat/${item.coli_sn}`, { replace: true }); + if ( ! isEmpty(item.coli_sn)) { setSwitchToC(item); setShouldFetchCList(false); + navigate(`/order/chat/${item.coli_sn}`, { replace: true }); } else { navigate(`/order/chat`, { replace: true }); }