From f814b08bcc90ad156ca68bda230c0e263caa7877 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Sat, 3 Feb 2024 17:26:57 -0800 Subject: [PATCH] fix: disable all documents by default --- .../chat/MessageInput/Documents.svelte | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/lib/components/chat/MessageInput/Documents.svelte b/src/lib/components/chat/MessageInput/Documents.svelte index 0219a111..587e59c0 100644 --- a/src/lib/components/chat/MessageInput/Documents.svelte +++ b/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)])];