|
|
@ -90,18 +90,15 @@ const Conversations = () => {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
const switchConversation = async (item) => {
|
|
|
|
const switchConversation = async (item) => {
|
|
|
|
if (currentConversation.sn === item.sn) {
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
dispatch(setCurrentConversation(item));
|
|
|
|
dispatch(setCurrentConversation(item));
|
|
|
|
if (isEmpty(item.coli_sn) || item.coli_sn === '0') {
|
|
|
|
|
|
|
|
dispatch(receivedCustomerProfile({}));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
const messagesList = activeConversations[`${item.sn}`] || [];
|
|
|
|
const messagesList = activeConversations[`${item.sn}`] || [];
|
|
|
|
if (isEmpty(messagesList)) {
|
|
|
|
if (isEmpty(messagesList)) {
|
|
|
|
const data = await fetchMessages({ opisn: userId, whatsappid: item.whatsapp_phone_number });
|
|
|
|
const data = await fetchMessages({ opisn: userId, whatsappid: item.whatsapp_phone_number });
|
|
|
|
dispatch(receivedMessageList(item.sn, data));
|
|
|
|
dispatch(receivedMessageList(item.sn, data));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (isEmpty(item.coli_sn) || item.coli_sn === '0') {
|
|
|
|
|
|
|
|
dispatch(receivedCustomerProfile({}));
|
|
|
|
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const onSwitchConversation = (item) => {
|
|
|
|
const onSwitchConversation = (item) => {
|
|
|
|