fix bug where share chatflow is not able to open on any other browser

This commit is contained in:
Henry
2023-06-29 23:47:20 +01:00
parent dc2f35bfad
commit 7141401e26
13 changed files with 183 additions and 73 deletions
@@ -134,7 +134,6 @@ const APICodeDialog = ({ show, dialogProps, onCancel }) => {
const [chatflowApiKeyId, setChatflowApiKeyId] = useState('')
const [selectedApiKey, setSelectedApiKey] = useState({})
const [checkboxVal, setCheckbox] = useState(false)
const [chatbotConfig, setChatbotConfig] = useState(null)
const getAllAPIKeysApi = useApi(apiKeyApi.getAllAPIKeys)
const updateChatflowApi = useApi(chatflowsApi.updateChatflow)
@@ -491,12 +490,6 @@ query({
setChatflowApiKeyId(dialogProps.chatflowApiKeyId)
setSelectedApiKey(getAllAPIKeysApi.data.find((key) => key.id === dialogProps.chatflowApiKeyId))
}
if (dialogProps.chatbotConfig) {
setChatbotConfig(JSON.parse(dialogProps.chatbotConfig))
} else {
setChatbotConfig(null)
}
}
}, [dialogProps, getAllAPIKeysApi.data])
@@ -601,9 +594,7 @@ query({
)}
</>
)}
{codeLang === 'Share Chatbot' && !chatflowApiKeyId && (
<ShareChatbot chatflowid={dialogProps.chatflowid} chatbotConfig={chatbotConfig} />
)}
{codeLang === 'Share Chatbot' && !chatflowApiKeyId && <ShareChatbot />}
</TabPanel>
))}
</DialogContent>