mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 21:00:58 +03:00
@@ -88,12 +88,12 @@ const ChatbotFull = () => {
|
|||||||
parsedConfig = { ...parsedConfig, ...JSON.parse(chatflowData.chatbotConfig) }
|
parsedConfig = { ...parsedConfig, ...JSON.parse(chatflowData.chatbotConfig) }
|
||||||
setChatbotTheme(parsedConfig)
|
setChatbotTheme(parsedConfig)
|
||||||
if (parsedConfig.overrideConfig) {
|
if (parsedConfig.overrideConfig) {
|
||||||
// Generate new sessionId
|
|
||||||
if (parsedConfig.overrideConfig.generateNewSession) {
|
|
||||||
parsedConfig.overrideConfig.sessionId = Date.now().toString()
|
|
||||||
}
|
|
||||||
setChatbotOverrideConfig(parsedConfig.overrideConfig)
|
setChatbotOverrideConfig(parsedConfig.overrideConfig)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (parsedConfig.generateNewSession) {
|
||||||
|
localStorage.removeItem(`${chatflowData.id}_EXTERNAL`)
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e)
|
console.error(e)
|
||||||
setChatbotTheme(parsedConfig)
|
setChatbotTheme(parsedConfig)
|
||||||
|
|||||||
@@ -111,8 +111,7 @@ const ShareChatbot = ({ isSessionMemory, isAgentCanvas }) => {
|
|||||||
userMessage: {
|
userMessage: {
|
||||||
showAvatar: false
|
showAvatar: false
|
||||||
},
|
},
|
||||||
textInput: {},
|
textInput: {}
|
||||||
overrideConfig: {}
|
|
||||||
}
|
}
|
||||||
if (title) obj.title = title
|
if (title) obj.title = title
|
||||||
if (titleAvatarSrc) obj.titleAvatarSrc = titleAvatarSrc
|
if (titleAvatarSrc) obj.titleAvatarSrc = titleAvatarSrc
|
||||||
@@ -137,7 +136,7 @@ const ShareChatbot = ({ isSessionMemory, isAgentCanvas }) => {
|
|||||||
if (textInputPlaceholder) obj.textInput.placeholder = textInputPlaceholder
|
if (textInputPlaceholder) obj.textInput.placeholder = textInputPlaceholder
|
||||||
if (textInputSendButtonColor) obj.textInput.sendButtonColor = textInputSendButtonColor
|
if (textInputSendButtonColor) obj.textInput.sendButtonColor = textInputSendButtonColor
|
||||||
|
|
||||||
if (isSessionMemory) obj.overrideConfig.generateNewSession = generateNewSession
|
if (isSessionMemory) obj.generateNewSession = generateNewSession
|
||||||
|
|
||||||
if (renderHTML) {
|
if (renderHTML) {
|
||||||
obj.renderHTML = true
|
obj.renderHTML = true
|
||||||
@@ -145,8 +144,6 @@ const ShareChatbot = ({ isSessionMemory, isAgentCanvas }) => {
|
|||||||
obj.renderHTML = false
|
obj.renderHTML = false
|
||||||
}
|
}
|
||||||
|
|
||||||
if (chatbotConfig?.starterPrompts) obj.starterPrompts = chatbotConfig.starterPrompts
|
|
||||||
|
|
||||||
if (isAgentCanvas) {
|
if (isAgentCanvas) {
|
||||||
// if showAgentMessages is undefined, default to true
|
// if showAgentMessages is undefined, default to true
|
||||||
if (showAgentMessages === undefined || showAgentMessages === null) {
|
if (showAgentMessages === undefined || showAgentMessages === null) {
|
||||||
@@ -156,9 +153,10 @@ const ShareChatbot = ({ isSessionMemory, isAgentCanvas }) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (chatbotConfig?.fullFileUpload) obj.fullFileUpload = chatbotConfig?.fullFileUpload
|
return {
|
||||||
|
...chatbotConfig,
|
||||||
return obj
|
...obj
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const onSave = async () => {
|
const onSave = async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user