perf: snap code (#3350)

* perf: readme

* perf: snap code
This commit is contained in:
Archer
2024-12-09 18:27:40 +08:00
committed by GitHub
parent c64d629a6a
commit 15dc7b220e
5 changed files with 6 additions and 8 deletions

View File

@@ -672,7 +672,7 @@ export const useWorkflow = () => {
export const useLoopNode = () => {
const nodes = useContextSelector(WorkflowInitContext, (state) => state.nodes);
const onNodesChange = useContextSelector(WorkflowNodeEdgeContext, (state) => state.onNodesChange);
const { onChangeNode } = useContextSelector(WorkflowContext, (v) => v);
const onChangeNode = useContextSelector(WorkflowContext, (v) => v.onChangeNode);
const resetParentNodeSizeAndPosition = useMemoizedFn((parentId: string) => {
const { childNodes, loopNode } = nodes.reduce(

View File

@@ -831,7 +831,7 @@ const WorkflowContextProvider = ({
const undo = useMemoizedFn(() => {
if (past.length > 1) {
forbiddenSaveSnapshot.current = true;
// Current version is the first one, so we need to reset the second one
const firstPast = past[1];
resetSnapshot(firstPast);