Skip to content

Commit

Permalink
fix: [Chat] Fix the problem that the dynamic change of the mode API o…
Browse files Browse the repository at this point in the history
…f the Chat component does not take effect
  • Loading branch information
YyumeiZhang committed Dec 11, 2024
1 parent 583ea2a commit 716b2fc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/semi-ui/chat/chatBox/chatBoxContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const ChatBoxContent = (props: ChatBoxContentProps) => {
[`${PREFIX_CHAT_BOX}-content-user`]: (bubble && isUser) || userBubble,
[`${PREFIX_CHAT_BOX}-content-error`]: status === MESSAGE_STATUS.ERROR && (bubble || userBubble)
});
}, [role, status]);
}, [role, status, mode]);

const node = useMemo(() => {
if (status === MESSAGE_STATUS.LOADING) {
Expand Down
2 changes: 1 addition & 1 deletion packages/semi-ui/chat/chatBox/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const ChatBox = React.memo((props: ChatBoxProps) => {
customMarkDownComponents={customMarkDownComponents}
customRenderFunc={renderChatBoxContent}
/>);
}, [message, info, renderChatBoxContent]);
}, [message, info, renderChatBoxContent, mode]);

const actionNode = useMemo(() => {
return (<ChatBoxAction
Expand Down

0 comments on commit 716b2fc

Please sign in to comment.