From d9e976d0bd17ba0b2489f86ace55c3b372044f88 Mon Sep 17 00:00:00 2001 From: Sebastien Flory Date: Wed, 27 Nov 2024 16:23:39 +0100 Subject: [PATCH] Restore previous behavior when posting a message --- .../conversation/input_bar/InputBar.tsx | 39 ++++++++++++------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/front/components/assistant/conversation/input_bar/InputBar.tsx b/front/components/assistant/conversation/input_bar/InputBar.tsx index fbbae6ccb4b8..c0e9d6a2185a 100644 --- a/front/components/assistant/conversation/input_bar/InputBar.tsx +++ b/front/components/assistant/conversation/input_bar/InputBar.tsx @@ -173,25 +173,36 @@ export function AssistantInputBar({ if (!conversationId) { setLoading(true); setDisableSendButton(true); - } - const r = await onSubmit( - text, - mentions, - fileUploaderService.getFileBlobs().map((cf) => { - return { - title: cf.filename, - fileId: cf.fileId, - }; - }) - ); + const r = await onSubmit( + text, + mentions, + fileUploaderService.getFileBlobs().map((cf) => { + return { + title: cf.filename, + fileId: cf.fileId, + }; + }) + ); - if (!conversationId) { setLoading(false); setDisableSendButton(false); - } + if (r.isOk()) { + resetEditorText(); + fileUploaderService.resetUpload(); + } + } else { + void onSubmit( + text, + mentions, + fileUploaderService.getFileBlobs().map((cf) => { + return { + title: cf.filename, + fileId: cf.fileId, + }; + }) + ); - if (r.isOk()) { resetEditorText(); fileUploaderService.resetUpload(); }