Skip to content

Commit a2d5cf9

Browse files
authored
Bugfix/show agent messages status on sharechatbot (#3851)
fix show agent messages status on sharechatbot
1 parent c36267c commit a2d5cf9

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

packages/ui/src/views/chatflows/ShareChatbot.jsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,15 @@ const ShareChatbot = ({ isSessionMemory, isAgentCanvas }) => {
7272
const [backgroundColor, setBackgroundColor] = useState(chatbotConfig?.backgroundColor ?? defaultConfig.backgroundColor)
7373
const [fontSize, setFontSize] = useState(chatbotConfig?.fontSize ?? defaultConfig.fontSize)
7474
const [poweredByTextColor, setPoweredByTextColor] = useState(chatbotConfig?.poweredByTextColor ?? defaultConfig.poweredByTextColor)
75-
const [showAgentMessages, setShowAgentMessages] = useState(chatbotConfig?.showAgentMessages || (isAgentCanvas ? true : undefined))
75+
76+
const getShowAgentMessagesStatus = () => {
77+
if (chatbotConfig?.showAgentMessages !== undefined) {
78+
return chatbotConfig?.showAgentMessages
79+
} else {
80+
return isAgentCanvas ? true : undefined
81+
}
82+
}
83+
const [showAgentMessages, setShowAgentMessages] = useState(getShowAgentMessagesStatus())
7684

7785
const [botMessageBackgroundColor, setBotMessageBackgroundColor] = useState(
7886
chatbotConfig?.botMessage?.backgroundColor ?? defaultConfig.botMessage.backgroundColor

0 commit comments

Comments
 (0)