Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

Fix: The file upload prompt indicates "No authorization." #6516 (#6756)

balibabu160bf4ccb350
diff --git a/web/src/hooks/document-hooks.ts b/web/src/hooks/document-hooks.ts
index b3e1ddfab9..37edeaac55 100644
--- a/web/src/hooks/document-hooks.ts
+++ b/web/src/hooks/document-hooks.ts
@@ -345,12 +345,17 @@ export const useRunNextDocument = () => {
export const useFetchDocumentInfosByIds = () => {
const [ids, setDocumentIds] = useState<string[]>([]);
+
+ const idList = useMemo(() => {
+ return ids.filter((x) => typeof x === 'string' && x !== '');
+ }, [ids]);
+
const { data } = useQuery<IDocumentInfo[]>({
- queryKey: ['fetchDocumentInfos', ids],
- enabled: ids.length > 0,
+ queryKey: ['fetchDocumentInfos', idList],
+ enabled: idList.length > 0,
initialData: [],
queryFn: async () => {
- const { data } = await kbService.document_infos({ doc_ids: ids });
+ const { data } = await kbService.document_infos({ doc_ids: idList });
if (data.code === 0) {
return data.data;
}