Skip to content

Commit

Permalink
fix: Resolve errors caused by Chrome's translation feature
Browse files Browse the repository at this point in the history
- Fix JavaScript errors occurring when Chrome's translation feature is enabled
- Resolve conflicts between elements inserted by the translation feature and application's DOM manipulation

References:
- facebook/react#11538 (comment)

Related Issue: aws-samples#518
  • Loading branch information
Ihara-kenta committed Jul 9, 2024
1 parent 8f31afa commit 5bafb47
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions packages/web/src/components/ChatMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,16 @@ const ChatMessage: React.FC<Props> = (props) => {
</div>
)}
{chatContent?.role === 'assistant' && (
<Markdown prefix={`${props.idx}`}>
{typingTextOutput +
`${
props.loading && (chatContent?.content ?? '') !== ''
? '▍'
: ''
}`}
</Markdown>
<span>
<Markdown prefix={`${props.idx}`}>
{typingTextOutput +
`${
props.loading && (chatContent?.content ?? '') !== ''
? '▍'
: ''
}`}
</Markdown>
</span>
)}
{chatContent?.role === 'system' && (
<div className="break-all">
Expand Down

0 comments on commit 5bafb47

Please sign in to comment.