fix: edges moving on just cloned flows (#6819)

* Changed export modal to just download after flow is built

* Changed cleanEdge to set edges animated to false

* Updated starter projects and tests to remove animated from edge

* update market research json to get global variable
This commit is contained in:
Lucas Oliveira 2025-02-26 17:46:54 -03:00 committed by GitHub
commit 7b3dc0b453
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 1072 additions and 1259 deletions

View file

@ -21,6 +21,7 @@ const ExportModal = forwardRef(
const setNoticeData = useAlertStore((state) => state.setNoticeData);
const [checked, setChecked] = useState(false);
const currentFlow = useFlowStore((state) => state.currentFlow);
const isBuilding = useFlowStore((state) => state.isBuilding);
useEffect(() => {
setName(currentFlow?.name ?? "");
setDescription(currentFlow?.description ?? "");
@ -105,7 +106,7 @@ const ExportModal = forwardRef(
</span>
</BaseModal.Content>
<BaseModal.Footer submit={{ label: "Export" }} />
<BaseModal.Footer submit={{ label: "Export", loading: isBuilding }} />
</BaseModal>
);
},

View file

@ -55,7 +55,9 @@ export function checkChatInput(nodes: Node[]) {
}
export function cleanEdges(nodes: AllNodeType[], edges: EdgeType[]) {
let newEdges = cloneDeep(edges);
let newEdges: EdgeType[] = cloneDeep(
edges.map((edge) => ({ ...edge, selected: false, animated: false })),
);
edges.forEach((edge) => {
// check if the source and target node still exists
const sourceNode = nodes.find((node) => node.id === edge.source);