Bugfix/Add showagent message when agentflow (#2749)
add showagent message when agentflow
This commit is contained in:
parent
512df4197c
commit
efc6e02828
|
|
@ -76,13 +76,16 @@ const ChatbotFull = () => {
|
|||
if (getSpecificChatflowFromPublicApi.data || getSpecificChatflowApi.data) {
|
||||
const chatflowData = getSpecificChatflowFromPublicApi.data || getSpecificChatflowApi.data
|
||||
setChatflow(chatflowData)
|
||||
|
||||
const chatflowType = chatflowData.type
|
||||
if (chatflowData.chatbotConfig) {
|
||||
let parsedConfig = {}
|
||||
if (chatflowType === 'MULTIAGENT') {
|
||||
parsedConfig.showAgentMessages = true
|
||||
}
|
||||
|
||||
try {
|
||||
const chatflowType = chatflowData.type
|
||||
const parsedConfig = JSON.parse(chatflowData.chatbotConfig)
|
||||
if (chatflowType === 'MULTIAGENT') {
|
||||
parsedConfig.showAgentMessages = true
|
||||
}
|
||||
parsedConfig = { ...parsedConfig, ...JSON.parse(chatflowData.chatbotConfig) }
|
||||
setChatbotTheme(parsedConfig)
|
||||
if (parsedConfig.overrideConfig) {
|
||||
// Generate new sessionId
|
||||
|
|
@ -93,9 +96,11 @@ const ChatbotFull = () => {
|
|||
}
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
setChatbotTheme({})
|
||||
setChatbotTheme(parsedConfig)
|
||||
setChatbotOverrideConfig({})
|
||||
}
|
||||
} else if (chatflowType === 'MULTIAGENT') {
|
||||
setChatbotTheme({ showAgentMessages: true })
|
||||
}
|
||||
}
|
||||
}, [getSpecificChatflowFromPublicApi.data, getSpecificChatflowApi.data])
|
||||
|
|
|
|||
Loading…
Reference in New Issue