Fixed bug where we cannot create new flow when we build a flow

This commit is contained in:
Lucas Oliveira 2023-07-10 15:59:38 -03:00
commit f035be88e4

View file

@ -72,7 +72,7 @@ export default function Chat({ flow }: ChatType) {
}
prevNodesRef.current = currentNodes;
}, [tabsState]);
}, [tabsState, flow.id]);
return (
<>
@ -83,9 +83,17 @@ export default function Chat({ flow }: ChatType) {
setIsBuilt={setIsBuilt}
isBuilt={isBuilt}
/>
{isBuilt && canOpen && (
<FormModal key={flow.id} flow={flow} open={open} setOpen={setOpen} />
)}
{isBuilt &&
tabsState[flow.id] &&
tabsState[flow.id].formKeysData &&
canOpen && (
<FormModal
key={flow.id}
flow={flow}
open={open}
setOpen={setOpen}
/>
)}
<ChatTrigger
canOpen={canOpen}
open={open}