fix: 修复一下
This commit is contained in:
parent
45a3660ab8
commit
b1031cf2b6
@ -14,7 +14,7 @@ import SkeletonItem from '@/components/memo/SkeletonItem';
|
||||
|
||||
// 类型定义
|
||||
import { useUploadManager } from '@/hooks/useUploadManager';
|
||||
import { getCachedData, prefetchChatDetail, prefetchChats } from '@/lib/prefetch';
|
||||
import { getCachedData, prefetchChatDetail } from '@/lib/prefetch';
|
||||
import { fetchApi } from '@/lib/server-api-util';
|
||||
import { Chat, getMessageText } from '@/types/ask';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
@ -105,18 +105,11 @@ const MemoList = () => {
|
||||
|
||||
const initialize = async () => {
|
||||
try {
|
||||
// 并行预加载资源和数据
|
||||
// 并行预加载资源和主数据
|
||||
await Promise.all([
|
||||
preloadAssets(),
|
||||
prefetchChats().then((data) => {
|
||||
if (isActive && data) {
|
||||
setHistoryList(data as Chat[]);
|
||||
}
|
||||
}),
|
||||
fetchHistoryList()
|
||||
]);
|
||||
|
||||
// 主数据加载
|
||||
await fetchHistoryList();
|
||||
} catch (error) {
|
||||
console.error('初始化失败:', error);
|
||||
} finally {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user