Skip to content

Commit 6ee3663

Browse files
committed
fixed having more than one states in null transition column in Null Closure
1 parent 6c9ae19 commit 6ee3663

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/features/components/nfaToDfa/NullClosure.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ let index = numberOfColumns;
3636

3737
export const NullClosure = (props: NullClosureProps) => {
3838
console.log("re rendering NullClosure, props: ", props);
39+
3940
const [duration, setDuration] = useState(AnimationDurationOptions[0]);
4041
const [isPlaying, setIsPlaying] = useState(false);
4142

@@ -132,7 +133,14 @@ export const NullClosure = (props: NullClosureProps) => {
132133
// display null transitions for every row except the last row
133134
rowIndex - 1 === mapIndex && index % 2 === 0
134135
? ""
135-
: row.state + (row.nul ? ", " : "") + row.nul,
136+
: Array.from(
137+
new Set(
138+
(
139+
row.state +
140+
(row.nul ? ", " + row.nul.split(" ").join(", ") : "")
141+
).split(", ")
142+
)
143+
).join(", "),
136144
};
137145
})
138146
);

0 commit comments

Comments
 (0)