Skip to content

Commit

Permalink
fix(pattern): fix add pattern stop when shape is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
landonreed committed May 14, 2018
1 parent 36f5d0f commit 4e04c5e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/editor/actions/map/stopStrategies.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ export function addStopToPattern (pattern, stop, index) {
return dispatch(saveActiveGtfsEntity('trippattern'))
})
} else {
dispatch(updatePatternStops(pattern, patternStops))
// Otherwise, check if a shape ought to be created. Then, save.
if (patternStops.length === 2 && followStreets) {
// Create shape between stops the added stop is the second one and
Expand All @@ -242,7 +243,6 @@ export function addStopToPattern (pattern, stop, index) {
.map((stop, index) => ({lng: stop.stop_lon, lat: stop.stop_lat}))
const patternSegments = await getPolyline(points, true)
// Update pattern stops and geometry.
dispatch(updatePatternStops(pattern, patternStops))
const controlPoints = controlPointsFromSegments(patternStops, patternSegments)
dispatch(updatePatternGeometry({controlPoints, patternSegments}))
}
Expand Down

0 comments on commit 4e04c5e

Please sign in to comment.