diff --git a/frontend/src/hooks/useSessionList.ts b/frontend/src/hooks/useSessionList.ts index 2ab76c3..0a49c89 100644 --- a/frontend/src/hooks/useSessionList.ts +++ b/frontend/src/hooks/useSessionList.ts @@ -63,14 +63,6 @@ export function useSessionList() { saveSessionSummaries(updated); }, []); - /** 保存当前会话的消息历史 */ - const saveCurrentSession = useCallback((messages: ChatMessage[]) => { - const id = sessionsRef.current.length > 0 ? sessionsRef.current[0].id : null; - // 找到 activeSessionId 对应的会话 - // 这里不依赖 activeSessionId state,而是通过参数传入 - return messages; - }, []); - /** 保存指定会话的消息并更新摘要 */ const persistSession = useCallback((sessionId: string, messages: ChatMessage[]) => { if (!sessionId) return; diff --git a/frontend/src/lib/errors.ts b/frontend/src/lib/errors.ts index 4bad345..44be571 100644 --- a/frontend/src/lib/errors.ts +++ b/frontend/src/lib/errors.ts @@ -3,7 +3,6 @@ // 来源:docs/03-接口文档.md §五 错误码 // ============================================================ -import type { ErrorCode } from "../types"; /** 将错误码转为用户友好文案(需要传入翻译函数) */ export function getErrorMessage(code: string, translate: (key: string) => string): string {