diff --git a/src/apps/chat/components/composer/llmattachments/LLMAttachmentsList.tsx b/src/apps/chat/components/composer/llmattachments/LLMAttachmentsList.tsx index 87f899461..67a89fdb2 100644 --- a/src/apps/chat/components/composer/llmattachments/LLMAttachmentsList.tsx +++ b/src/apps/chat/components/composer/llmattachments/LLMAttachmentsList.tsx @@ -33,7 +33,7 @@ export type LLMAttachmentDraftsAction = 'inline-text' | 'copy-text'; * Renderer of attachment drafts, with menus, etc. */ export function LLMAttachmentsList(props: { - agiAttachmentPrompts: AgiAttachmentPromptsData + agiAttachmentPrompts?: AgiAttachmentPromptsData, attachmentDraftsStoreApi: AttachmentDraftsStoreApi, canInlineSomeFragments: boolean, llmAttachmentDrafts: LLMAttachmentDraft[], @@ -142,7 +142,7 @@ export function LLMAttachmentsList(props: { {/* AI Suggestion Button */} - {(agiAttachmentPrompts.isVisible || agiAttachmentPrompts.hasData) && ( + {(!!agiAttachmentPrompts && (agiAttachmentPrompts.isVisible || agiAttachmentPrompts.hasData)) && ( )} @@ -212,10 +212,12 @@ export function LLMAttachmentsList(props: { placement='top-start' > {/* uses the agiAttachmentPrompts to imagine what the user will ask aboud those */} - - {agiAttachmentPrompts.isFetching ? : } - What can I do? - + {!!agiAttachmentPrompts && ( + + {agiAttachmentPrompts.isFetching ? : } + What can I do? + + )}