Fixed undoing not fixing group edges
This commit is contained in:
parent
f93724eb44
commit
abe597823b
1 changed files with 3 additions and 1 deletions
|
|
@ -24,6 +24,7 @@ import useAlertStore from "./alertStore";
|
|||
import { useDarkStore } from "./darkStore";
|
||||
import useFlowStore from "./flowStore";
|
||||
import { useTypesStore } from "./typesStore";
|
||||
import { cloneDeep } from "lodash";
|
||||
|
||||
let saveTimeoutId: NodeJS.Timeout | null = null;
|
||||
|
||||
|
|
@ -328,7 +329,8 @@ const useFlowsManagerStore = create<FlowsManagerStoreType>((set, get) => ({
|
|||
takeSnapshot: () => {
|
||||
const currentFlowId = get().currentFlowId;
|
||||
// push the current graph to the past state
|
||||
const newState = useFlowStore.getState();
|
||||
const flowStore = useFlowStore.getState();
|
||||
const newState = {nodes: cloneDeep(flowStore.nodes), edges: cloneDeep(flowStore.edges)};
|
||||
const pastLength = past[currentFlowId]?.length ?? 0;
|
||||
if (
|
||||
pastLength > 0 &&
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue