fix: 修复一下

This commit is contained in:
Junhui Chen 2025-08-07 19:04:46 +08:00
parent 45a3660ab8
commit b1031cf2b6

View File

@ -14,7 +14,7 @@ import SkeletonItem from '@/components/memo/SkeletonItem';
// 类型定义 // 类型定义
import { useUploadManager } from '@/hooks/useUploadManager'; 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 { fetchApi } from '@/lib/server-api-util';
import { Chat, getMessageText } from '@/types/ask'; import { Chat, getMessageText } from '@/types/ask';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
@ -105,18 +105,11 @@ const MemoList = () => {
const initialize = async () => { const initialize = async () => {
try { try {
// 并行预加载资源和数据 // 并行预加载资源和数据
await Promise.all([ await Promise.all([
preloadAssets(), preloadAssets(),
prefetchChats().then((data) => { fetchHistoryList()
if (isActive && data) {
setHistoryList(data as Chat[]);
}
}),
]); ]);
// 主数据加载
await fetchHistoryList();
} catch (error) { } catch (error) {
console.error('初始化失败:', error); console.error('初始化失败:', error);
} finally { } finally {