diff --git a/surfsense_web/components/chat_v2/ChatInputGroup.tsx b/surfsense_web/components/chat_v2/ChatInputGroup.tsx index 6229d1f..44824d2 100644 --- a/surfsense_web/components/chat_v2/ChatInputGroup.tsx +++ b/surfsense_web/components/chat_v2/ChatInputGroup.tsx @@ -42,7 +42,8 @@ const DocumentSelector = React.memo( const [isOpen, setIsOpen] = useState(false); const { documents, loading, isLoaded, fetchDocuments } = useDocuments( - Number(search_space_id) + Number(search_space_id), + true ); const handleOpenChange = useCallback( diff --git a/surfsense_web/hooks/use-documents.ts b/surfsense_web/hooks/use-documents.ts index d38b374..a7d3731 100644 --- a/surfsense_web/hooks/use-documents.ts +++ b/surfsense_web/hooks/use-documents.ts @@ -23,7 +23,7 @@ export type DocumentType = | "LINEAR_CONNECTOR" | "DISCORD_CONNECTOR"; -export function useDocuments(searchSpaceId: number, lazy: boolean = true) { +export function useDocuments(searchSpaceId: number, lazy: boolean = false) { const [documents, setDocuments] = useState([]); const [loading, setLoading] = useState(!lazy); // Don't show loading initially for lazy mode const [error, setError] = useState(null);