Skip to content

Commit

Permalink
chore: disable chat history button when streaming
Browse files Browse the repository at this point in the history
  • Loading branch information
Shibani Basava authored and Shibani Basava committed Nov 30, 2023
1 parent 58aae8a commit 60e3442
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/chat-component/src/components/chat-component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,9 @@ export class ChatComponent extends LitElement {
${this.isChatStarted
? html`
<div class="chat__header">
${this.interactionModel === 'chat' ? this.chatHistoryController.renderHistoryButton() : ''}
${this.interactionModel === 'chat'
? this.chatHistoryController.renderHistoryButton({ disabled: this.isDisabled })
: ''}
<chat-action-button
.label="${globalConfig.RESET_CHAT_BUTTON_TITLE}"
actionId="chat-reset-button"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,13 @@ export class ChatHistoryController implements ReactiveController {
this.showChatHistory = !this.showChatHistory;
}

renderHistoryButton() {
renderHistoryButton(options: { disabled: boolean } | undefined) {
return html`
<chat-action-button
.label="${this.showChatHistory ? globalConfig.HIDE_CHAT_HISTORY_LABEL : globalConfig.SHOW_CHAT_HISTORY_LABEL}"
actionId="chat-history-button"
@click="${(event) => this.handleChatHistoryButtonClick(event)}"
.isDisabled="${options?.disabled}"
.svgIcon="${this.showChatHistory ? iconHistoryDismiss : iconHistory}"
>
</chat-action-button>
Expand Down

0 comments on commit 60e3442

Please sign in to comment.