瀏覽代碼

fix: 修复 TypeScript 类型错误 - selectConversation 支持 null

537yaha 8 月之前
父節點
當前提交
5afa9624c9
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      frontend/features/agent/hooks/useConversations.ts

+ 1 - 1
frontend/features/agent/hooks/useConversations.ts

@@ -126,7 +126,7 @@ export function useConversations(options?: UseConversationsOptions) {
     return () => clearTimeout(handler);
   }, [searchQuery, conversations, isInitialLoad, applyFilter, agentId]);
 
-  const selectConversation = useCallback((conversationId: number) => {
+  const selectConversation = useCallback((conversationId: number | null) => {
     setSelectedConversationId((prev) =>
       prev === conversationId ? prev : conversationId
     );