From c564ff7c9937240bc5b06fa40f4d319ec0c2ac23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Jos=C3=A9=20Borba=20Fernandes?= Date: Wed, 31 Jul 2024 10:15:55 -0300 Subject: [PATCH] fix: removing unecessary min-height of chat --- .../orama-chat-box/orama-chat-box.tsx | 7 +---- .../ui-stencil/src/services/ChatService.ts | 28 +++++++++---------- 2 files changed, 14 insertions(+), 21 deletions(-) diff --git a/packages/ui-stencil/src/components/orama-chat-box/orama-chat-box.tsx b/packages/ui-stencil/src/components/orama-chat-box/orama-chat-box.tsx index ecc3873d..aa9bd20f 100644 --- a/packages/ui-stencil/src/components/orama-chat-box/orama-chat-box.tsx +++ b/packages/ui-stencil/src/components/orama-chat-box/orama-chat-box.tsx @@ -38,12 +38,7 @@ export class ChatBox { return ( // * Note: only dark theme supported at the moment - + ) } diff --git a/packages/ui-stencil/src/services/ChatService.ts b/packages/ui-stencil/src/services/ChatService.ts index 1fa04a20..c4e6bfc2 100644 --- a/packages/ui-stencil/src/services/ChatService.ts +++ b/packages/ui-stencil/src/services/ChatService.ts @@ -49,22 +49,20 @@ export class ChatService { }) } - // TODO: WE may want to reveive ask props as a Service prop instead of enforcing it here - return this.answerSession.ask({ term: term, related: { howMany: 3, format: 'question' } }) - // TODO: ABORT/ERROR/STOP should emmit onStateChange event. Keeping the lines below as a reference - // .catch((error) => { - // chatContext.interactions = chatContext.interactions.map((interaction, index) => { - // if (index === chatContext.interactions.length - 1) { - // return { - // ...interaction, - // status: TAnswerStatus.error, - // } - // } - // return interaction - // }) - // console.error(error) - // }) + // TODO: WE may want to reveive ask props as a Service prop instead of enforcing it here + return this.answerSession.ask({ term: term, related: { howMany: 3, format: 'question' } }).catch((error) => { + chatContext.interactions = chatContext.interactions.map((interaction, index) => { + if (index === chatContext.interactions.length - 1) { + return { + ...interaction, + status: TAnswerStatus.error, + } + } + return interaction + }) + console.error(error) + }) } abortAnswer = () => {