Skip to content

Commit abd0f34

Browse files
committed
fix(timetable): always default to pattern stop index for trip stop sequences
1 parent d313e05 commit abd0f34

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/editor/components/timetable/TimetableEditor.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,10 @@ export default class TimetableEditor extends Component {
116116
objectPath.set(newRow, `stopTimes.${i}.departureTime`, cumulativeTravelTime)
117117
objectPath.set(newRow, `stopTimes.${i}.timepoint`, stop.timepoint || 0)
118118
objectPath.set(newRow, `stopTimes.${i}.shapeDistTraveled`, stop.shapeDistTraveled)
119-
objectPath.set(newRow, `stopTimes.${i}.stopSequence`, stop.stopSequence)
119+
// Use pattern stop index to set stop sequence. Stop sequences should all
120+
// be zero-based and incrementing in the editor, but in the case that
121+
// they're not (e.g., due to a bad import) simply default to the index.
122+
objectPath.set(newRow, `stopTimes.${i}.stopSequence`, i)
120123
// }
121124
}
122125
for (let i = 0; i < this.props.timetable.columns.length; i++) {

0 commit comments

Comments
 (0)