From 716b2fcabc79395713b6260ee792777d6365c552 Mon Sep 17 00:00:00 2001 From: "zhangyumei.0319" Date: Wed, 11 Dec 2024 19:57:29 +0800 Subject: [PATCH] fix: [Chat] Fix the problem that the dynamic change of the mode API of the Chat component does not take effect --- packages/semi-ui/chat/chatBox/chatBoxContent.tsx | 2 +- packages/semi-ui/chat/chatBox/index.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/semi-ui/chat/chatBox/chatBoxContent.tsx b/packages/semi-ui/chat/chatBox/chatBoxContent.tsx index 692063b8bf..c7aab9010c 100644 --- a/packages/semi-ui/chat/chatBox/chatBoxContent.tsx +++ b/packages/semi-ui/chat/chatBox/chatBoxContent.tsx @@ -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) { diff --git a/packages/semi-ui/chat/chatBox/index.tsx b/packages/semi-ui/chat/chatBox/index.tsx index db11fe42d4..9bc1f151f0 100644 --- a/packages/semi-ui/chat/chatBox/index.tsx +++ b/packages/semi-ui/chat/chatBox/index.tsx @@ -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 (