diff --git a/src/actions/ConversationActions.js b/src/actions/ConversationActions.js index c847625..25bf728 100644 --- a/src/actions/ConversationActions.js +++ b/src/actions/ConversationActions.js @@ -205,7 +205,7 @@ export const fetchConversationsSearch = async (params) => { opi_sn: ele.OPI_SN || ele.opi_sn || 0, OPI_Name: `${ele.OPI_Name || ele.opi_name || ''}`.trim(), opi_name: `${ele.OPI_Name || ele.opi_name || ''}`.trim(), - dateText: dayjs((ele.lasttime || ele.lasttime)).format('MM-DD HH:mm'), + dateText: dayjs((ele.lasttime)).format('MM-DD HH:mm'), matchMsgList: parseRenderMessageList((ele.msglist_AsJOSN || [])), // .reverse()), coli_id: '', })); @@ -218,14 +218,15 @@ export const fetchConversationsSearch = async (params) => { */ export const fetchMessagesHistory = async (params) => { const defaultParams = { - opisn: '', - whatsappid: '', + // opisn: '', + // whatsappid: '', + conversationid: '', lasttime: '2024-01-01T00:00:00', pagesize: MESSAGE_PAGE_SIZE, pagedir: 'next', }; const _params = pick(params, Object.keys(defaultParams)); - if (isEmpty(_params.whatsappid)) { + if (isEmpty(_params.conversationid)) { return []; } const { errcode, result } = await fetchJSON(`${API_HOST}/get_item_messages`, {...defaultParams, ..._params}); diff --git a/src/stores/FormStore.js b/src/stores/FormStore.js index fff6a4b..d01c859 100644 --- a/src/stores/FormStore.js +++ b/src/stores/FormStore.js @@ -28,6 +28,6 @@ export const useFormStore = create( setOrderFollowForm: (orderFollowForm) => set({ orderFollowForm }), orderFollowAdvanceChecked: false, setOrderFollowAdvanceChecked: (orderFollowAdvanceChecked) => set({ orderFollowAdvanceChecked }), - })) + }), { name: 'form-store' }) ); export default useFormStore; diff --git a/src/views/Conversations/History/MessagesList.jsx b/src/views/Conversations/History/MessagesList.jsx index 50bbb1b..dc7b560 100644 --- a/src/views/Conversations/History/MessagesList.jsx +++ b/src/views/Conversations/History/MessagesList.jsx @@ -8,7 +8,7 @@ import { isEmpty, stringToColour, groupBy, isNotEmpty } from '@/utils/commons'; import { useShallow } from 'zustand/react/shallow'; import MergeConversationTo from './MergeConversationTo'; -const BIG_PAGE_SIZE = MESSAGE_PAGE_SIZE * 100; +const BIG_PAGE_SIZE = MESSAGE_PAGE_SIZE * 20; const MessagesList = ({ ...props }) => { const { message: appMessage } = App.useApp(); @@ -64,7 +64,8 @@ const MessagesList = ({ ...props }) => { if (isEmpty(selectedConversation.conversationid)) { return () => {}; } - const firstActionPageParams = { opisn: (selectedConversation.opi_sn || 0), whatsappid: selectedConversation.whatsapp_phone_number, loadNextPage: true }; + // opisn: (selectedConversation.opi_sn || 0), whatsappid: selectedConversation.whatsapp_phone_number, + const firstActionPageParams = { conversationid: selectedConversation.conversationid , loadNextPage: true }; // if (isEmpty(selectedConversation.matchMsgList)) { if (!isEmpty(formValues?.from_date)) { firstActionPageParams.lasttime = formValues.from_date;