fix: 会话列表: 没有时间的会话

2.0/email-builder
Lei OT 10 months ago
parent 48ebe3a775
commit 1218dcd81d

@ -4,7 +4,7 @@ import { Input, Button, Empty, Tooltip, List } from 'antd';
import { PlusOutlined, LoadingOutlined, HistoryOutlined, FireOutlined,AudioTwoTone } from '@ant-design/icons';
import { fetchConversationsList, fetchOrderConversationsList, CONVERSATION_PAGE_SIZE } from '@/actions/ConversationActions';
import ConversationsNewItem from './ConversationsNewItem';
import { debounce, isEmpty, isNotEmpty, pick } from '@/utils/commons';
import { debounce, flush, isEmpty, isNotEmpty, pick } from '@/utils/commons';
import useConversationStore from '@/stores/ConversationStore';
import useAuthStore from '@/stores/AuthStore';
import { useVisibilityState } from '@/hooks/useVisibilityState';
@ -76,8 +76,10 @@ const Conversations = () => {
} else {
addToConversationList(_list, 'next');
}
const pageTimeArr = flush(_list.map(item => item.lasttime));
const _lasttime = pageTimeArr.pop()
setFilter({
lastpagetime: _list.length > 0 ? _list[_list.length - 1].lasttime : '',
lastpagetime: _lasttime || '',
loadNextPage: !(_list.length === 0 || _list.length < CONVERSATION_PAGE_SIZE),
// ...((_list.length === 0 || _list.length < CONVERSATION_PAGE_SIZE) ? {
// lastactivetime: dayjs(filterState.lastactivetime).subtract(6, 'months').format(DATETIME_FORMAT),

Loading…
Cancel
Save