Update how chatflow data is updated when configuration dialog is open

This commit is contained in:
Ilango
2024-03-12 18:11:18 +05:30
parent 3096a0fa50
commit c2ecb48900
2 changed files with 14 additions and 19 deletions
@@ -171,6 +171,13 @@ const CanvasHeader = ({ chatflow, handleSaveFlow, handleDeleteFlow, handleLoadFl
useEffect(() => {
if (chatflow) {
setFlowName(chatflow.name)
// if configuration dialog is open, update its data
if (chatflowConfigurationDialogOpen) {
setChatflowConfigurationDialogProps({
title: 'Chatflow Configuration',
chatflow
})
}
}
}, [chatflow])
@@ -381,6 +388,7 @@ const CanvasHeader = ({ chatflow, handleSaveFlow, handleDeleteFlow, handleLoadFl
onCancel={() => setViewMessagesDialogOpen(false)}
/>
<ChatflowConfigurationDialog
key='chatflowConfiguration'
show={chatflowConfigurationDialogOpen}
dialogProps={chatflowConfigurationDialogProps}
onCancel={() => setChatflowConfigurationDialogOpen(false)}