Skip to content

Commit

Permalink
fix: Output header to show state label and not id [PT-187357457]
Browse files Browse the repository at this point in the history
  • Loading branch information
dougmartin committed Apr 3, 2024
1 parent 8378bdb commit 1cd30c8
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 1cd30c8

Please sign in to comment.