Skip to content

Commit

Permalink
fix: removing unecessary min-height of chat
Browse files Browse the repository at this point in the history
  • Loading branch information
rjborba committed Jul 31, 2024
1 parent dd09fa7 commit c564ff7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,7 @@ export class ChatBox {
return (
// * Note: only dark theme supported at the moment
<Host id="orama-ui-chatbox" class="theme-dark">
<orama-chat
placeholder={this.placeholder}
sourceBaseUrl={this.sourceBaseUrl}
sourcesMap={this.sourcesMap}
style={{ minHeight: '400px' }}
/>
<orama-chat placeholder={this.placeholder} sourceBaseUrl={this.sourceBaseUrl} sourcesMap={this.sourcesMap} />
</Host>
)
}
Expand Down
28 changes: 13 additions & 15 deletions packages/ui-stencil/src/services/ChatService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand Down

0 comments on commit c564ff7

Please sign in to comment.