File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
packages/ui/src/views/chatflows Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -72,7 +72,15 @@ const ShareChatbot = ({ isSessionMemory, isAgentCanvas }) => {
72
72
const [ backgroundColor , setBackgroundColor ] = useState ( chatbotConfig ?. backgroundColor ?? defaultConfig . backgroundColor )
73
73
const [ fontSize , setFontSize ] = useState ( chatbotConfig ?. fontSize ?? defaultConfig . fontSize )
74
74
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 ( ) )
76
84
77
85
const [ botMessageBackgroundColor , setBotMessageBackgroundColor ] = useState (
78
86
chatbotConfig ?. botMessage ?. backgroundColor ?? defaultConfig . botMessage . backgroundColor
You can’t perform that action at this time.
0 commit comments