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)])];