From ef35864e1668bf1f1e4b41be396b4215959db6cb Mon Sep 17 00:00:00 2001 From: ManishMadan2882 Date: Mon, 9 Jun 2025 19:50:07 +0530 Subject: [PATCH] (fix) type error, ui adjust --- frontend/src/assets/alert.svg | 2 +- frontend/src/components/MessageInput.tsx | 9 ++------- frontend/src/conversation/ConversationBubble.tsx | 6 ++++-- frontend/src/conversation/conversationHandlers.ts | 13 +++++-------- 4 files changed, 12 insertions(+), 18 deletions(-) diff --git a/frontend/src/assets/alert.svg b/frontend/src/assets/alert.svg index 05c7634b..07721b57 100644 --- a/frontend/src/assets/alert.svg +++ b/frontend/src/assets/alert.svg @@ -1,3 +1,3 @@ - + diff --git a/frontend/src/components/MessageInput.tsx b/frontend/src/components/MessageInput.tsx index 1db5c2c8..fb405316 100644 --- a/frontend/src/components/MessageInput.tsx +++ b/frontend/src/components/MessageInput.tsx @@ -263,7 +263,7 @@ export default function MessageInput({ {attachments.map((attachment, index) => (
)} diff --git a/frontend/src/conversation/ConversationBubble.tsx b/frontend/src/conversation/ConversationBubble.tsx index 709a9843..102a8363 100644 --- a/frontend/src/conversation/ConversationBubble.tsx +++ b/frontend/src/conversation/ConversationBubble.tsx @@ -107,13 +107,15 @@ const ConversationBubble = forwardRef<
setIsQuestionHovered(true)} onMouseLeave={() => setIsQuestionHovered(false)} + className={className} >
{filesAttached && filesAttached.length > 0 && ( -
+
{filesAttached.map((file, index) => (
@@ -132,7 +134,7 @@ const ConversationBubble = forwardRef< )}
= [], - attachments: string[] = [], // Add attachments parameter with default empty array + attachments: string[] = [], onEvent: (event: MessageEvent) => void, ): Promise { history = history.map((item) => { @@ -301,7 +301,7 @@ export function handleFetchSharedAnswerStreaming( //for shared conversations history: JSON.stringify(history), api_key: apiKey, save_conversation: false, - attachments: attachments.length > 0 ? attachments : undefined, // Add attachments to payload + attachments: attachments.length > 0 ? attachments : undefined, }; conversationService .answerStream(payload, null, signal) @@ -376,13 +376,10 @@ export function handleFetchSharedAnswer( const payload = { question: question, api_key: apiKey, + attachments: + attachments && attachments.length > 0 ? attachments : undefined, }; - // Add attachments to payload if they exist - if (attachments && attachments.length > 0) { - payload.attachments = attachments; - } - return conversationService .answer(payload, null, signal) .then((response) => {