Skip to content

Commit

Permalink
Display the correct answer when the graph is static
Browse files Browse the repository at this point in the history
  • Loading branch information
benchristel committed Aug 9, 2024
1 parent cfb342c commit e367f09
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export type StatefulMafsGraphProps = {
box: [number, number];
backgroundImage?: InteractiveGraphProps["backgroundImage"];
graph: PerseusGraphType;
correct: PerseusGraphType;
lockedFigures?: InteractiveGraphProps["lockedFigures"];
range: InteractiveGraphProps["range"];
snapStep: InteractiveGraphProps["snapStep"];
Expand Down Expand Up @@ -128,5 +129,9 @@ export const StatefulMafsGraph = React.forwardRef<
graph.startCoords,
]);

if (props.static) {
return <MafsGraph {...props} state={initializeGraphState({...props, graph: props.correct})} dispatch={dispatch} />
}

return <MafsGraph {...props} state={state} dispatch={dispatch} />;
});

0 comments on commit e367f09

Please sign in to comment.