|
|
|
@ -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 });
|
|
|
|
|
}
|
|
|
|
|