Skip to content

Commit

Permalink
fix: previous links correctly updated
Browse files Browse the repository at this point in the history
  • Loading branch information
seankwarren committed Jun 14, 2023
1 parent d5b09d5 commit fbd3342
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function setUnitsHead(units) {
export function setNextLinks(units) {
const flowchartIds = units.map((u) => u.flowchartId);
for (let i = 0; i < units.length - 1; i++) {
if (!units[i].next) {
if (!units[i].next || units[i].next !== units[i + 1].flowchartId) {
// newly added units don't have next set yet => set it
units[i].next = units[i + 1].flowchartId;
if (i > 0) units[i - 1].next = units[i].flowchartId;
Expand Down

0 comments on commit fbd3342

Please sign in to comment.