Skip to content

Commit

Permalink
refactor: clean up old error state
Browse files Browse the repository at this point in the history
  • Loading branch information
g-francesca committed Jul 24, 2024
1 parent e439005 commit 61a1ec7
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class OramaChatUserMessage {
return (
<Host>
<div class="message-wrapper">
<orama-text as="h2" class="chat-question">
<orama-text as="h2" styledAs="p" class="chat-question">
{this.interaction.query}
</orama-text>
</div>
Expand Down
2 changes: 0 additions & 2 deletions packages/ui-stencil/src/context/chatContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,8 @@ export type TChatInteraction = {
}

const { state: chatContext } = createStore({
// TODO: Evaluate if we need to have a error object/string instead of just a boolean
chatService: null as ChatService | null,
interactions: [] as TChatInteraction[],
error: false,
})

export { chatContext }
2 changes: 0 additions & 2 deletions packages/ui-stencil/src/services/ChatService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export class ChatService {
if (!this.oramaClient) {
throw new OramaClientNotInitializedError()
}
chatContext.error = false

// TODO: possibly fix on Orama Client
chatContext.interactions = [...chatContext.interactions, { query: term, status: TAnswerStatus.loading }]
Expand Down Expand Up @@ -66,7 +65,6 @@ export class ChatService {
})
}

chatContext.error = false
return this.answerSession.ask({ term: term }).catch((error) => {
chatContext.interactions = chatContext.interactions.map((interaction, index) => {
if (index === chatContext.interactions.length - 1) {
Expand Down

0 comments on commit 61a1ec7

Please sign in to comment.