Bugfix/show agent messages status on sharechatbot (#3851)

fix show agent messages status on sharechatbot
This commit is contained in:
Henry Heng
2025-01-11 16:50:03 +00:00
committed by GitHub
parent c36267cf74
commit a2d5cf979c
@@ -72,7 +72,15 @@ const ShareChatbot = ({ isSessionMemory, isAgentCanvas }) => {
const [backgroundColor, setBackgroundColor] = useState(chatbotConfig?.backgroundColor ?? defaultConfig.backgroundColor)
const [fontSize, setFontSize] = useState(chatbotConfig?.fontSize ?? defaultConfig.fontSize)
const [poweredByTextColor, setPoweredByTextColor] = useState(chatbotConfig?.poweredByTextColor ?? defaultConfig.poweredByTextColor)
const [showAgentMessages, setShowAgentMessages] = useState(chatbotConfig?.showAgentMessages || (isAgentCanvas ? true : undefined))
const getShowAgentMessagesStatus = () => {
if (chatbotConfig?.showAgentMessages !== undefined) {
return chatbotConfig?.showAgentMessages
} else {
return isAgentCanvas ? true : undefined
}
}
const [showAgentMessages, setShowAgentMessages] = useState(getShowAgentMessagesStatus())
const [botMessageBackgroundColor, setBotMessageBackgroundColor] = useState(
chatbotConfig?.botMessage?.backgroundColor ?? defaultConfig.botMessage.backgroundColor