Browse Source

fix: disable all documents by default

Timothy J. Baek 1 năm trước cách đây
mục cha
commit
f814b08bcc
1 tập tin đã thay đổi với 10 bổ sung6 xóa
  1. 10 6
      src/lib/components/chat/MessageInput/Documents.svelte

+ 10 - 6
src/lib/components/chat/MessageInput/Documents.svelte

@@ -17,12 +17,16 @@
 	let collections = [];
 
 	$: collections = [
-		{
-			name: 'All Documents',
-			type: 'collection',
-			title: 'All Documents',
-			collection_names: $documents.map((doc) => doc.collection_name)
-		},
+		...($documents.length > 0
+			? [
+					{
+						name: 'All Documents',
+						type: 'collection',
+						title: 'All Documents',
+						collection_names: $documents.map((doc) => doc.collection_name)
+					}
+			  ]
+			: []),
 		...$documents
 			.reduce((a, e, i, arr) => {
 				return [...new Set([...a, ...(e?.content?.tags ?? []).map((tag) => tag.name)])];