Skip to content

Commit

Permalink
Merge pull request #34 from concord-consortium/187357457-fix-output-s…
Browse files Browse the repository at this point in the history
…tate-label

fix: Output header to show state label and not id [PT-187357457]
  • Loading branch information
dougmartin authored Apr 3, 2024
2 parents 4fb1b62 + 1cd30c8 commit f2246c0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@ const AnimationDelay = 1000;

type SequenceGroup = {
startingState: string;
startingNode: Node | undefined;
delimiter: string;
lengthLimit: number;
sequences: Node[][];
};

const SequenceOutputHeader = ({ group }: { group: SequenceGroup }) => {
const [expanded, setExpanded] = useState(false);
const startingState = group.startingState.length > 0 ? group.startingState : AnyStartingState;
const startingState = group.startingNode?.label ?? AnyStartingState;
const lengthLimit = group.lengthLimit;
const delimiter = group.delimiter === "" ? "(none)" : `"${group.delimiter}"`;

Expand Down Expand Up @@ -122,7 +123,7 @@ export const App = () => {
(currentAnimatedSequenceGroup.current.delimiter !== delimiter) ||
(currentAnimatedSequenceGroup.current.lengthLimit !== lengthLimit) ||
(currentAnimatedSequenceGroup.current.startingState !== startingState)) {
currentAnimatedSequenceGroup.current = { delimiter, lengthLimit, startingState, sequences: [] };
currentAnimatedSequenceGroup.current = { delimiter, lengthLimit, startingState, startingNode, sequences: [] };
setSequenceGroups(prevAnimatedSequenceGroups.current);
} else {
prevAnimatedSequenceGroups.current.pop();
Expand Down

0 comments on commit f2246c0

Please sign in to comment.