Skip to content

Commit

Permalink
save/load added operation IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
sc420 committed Feb 27, 2024
1 parent 92ab245 commit 6cdaccc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,7 @@ const GraphContainer: FunctionComponent<GraphContainerProps> = ({
nextNodeId,
nodeNameBuilderState,
nextOperationId,
operationIdsAddedAtLeastOnce: Array.from(operationIdsAddedAtLeastOnce),
reactFlowState: reactFlowInstance.toObject(),
};
}, [
Expand All @@ -550,6 +551,7 @@ const GraphContainer: FunctionComponent<GraphContainerProps> = ({
nextNodeId,
nextOperationId,
nodeNameBuilder,
operationIdsAddedAtLeastOnce,
reactFlowInstance,
saveFeatureOperations,
]);
Expand Down Expand Up @@ -630,6 +632,9 @@ const GraphContainer: FunctionComponent<GraphContainerProps> = ({
setNextNodeId(graphContainerState.nextNodeId);
nodeNameBuilder.load(graphContainerState.nodeNameBuilderState);
setNextOperationId(graphContainerState.nextOperationId);
setOperationIdsAddedAtLeastOnce(
new Set(graphContainerState.operationIdsAddedAtLeastOnce),
);
loadReactFlow(graphContainerState.reactFlowState);
},
[coreGraphAdapter, loadFeatureOperations, loadReactFlow, nodeNameBuilder],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import type FeatureOperationState from "./FeatureOperationState";
import type NodeNameBuilderState from "./NodeNameBuilderState";

interface GraphContainerState {
// TODO(sc420): Uncomment other states
// Core graph
coreGraphAdapterState: CoreGraphAdapterState;

Expand All @@ -16,7 +15,7 @@ interface GraphContainerState {
nextOperationId: number;

// Feature panel states
// operationIdsAddedAtLeastOnce: Set<string>;
operationIdsAddedAtLeastOnce: string[];

// React Flow states
reactFlowState: object;
Expand Down

0 comments on commit 6cdaccc

Please sign in to comment.