fix: 移除未使用的变量和导入,修复 tsc 编译错误
This commit is contained in:
@@ -63,14 +63,6 @@ export function useSessionList() {
|
|||||||
saveSessionSummaries(updated);
|
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[]) => {
|
const persistSession = useCallback((sessionId: string, messages: ChatMessage[]) => {
|
||||||
if (!sessionId) return;
|
if (!sessionId) return;
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
// 来源:docs/03-接口文档.md §五 错误码
|
// 来源:docs/03-接口文档.md §五 错误码
|
||||||
// ============================================================
|
// ============================================================
|
||||||
|
|
||||||
import type { ErrorCode } from "../types";
|
|
||||||
|
|
||||||
/** 将错误码转为用户友好文案(需要传入翻译函数) */
|
/** 将错误码转为用户友好文案(需要传入翻译函数) */
|
||||||
export function getErrorMessage(code: string, translate: (key: string) => string): string {
|
export function getErrorMessage(code: string, translate: (key: string) => string): string {
|
||||||
|
|||||||
Reference in New Issue
Block a user