Skip to content

Commit

Permalink
first flow fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
miles-grant-ibigroup committed Jan 31, 2024
1 parent e754c45 commit 427723e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions lib/editor/actions/map/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ export function removeControlPoint (controlPoints: Array<ControlPoint>, index: n
}))

// Ensure that all updates are reflected in exports.
// $FlowFixMe Is this ok?
dispatch(updatePatternStops(pattern, pattern.patternStops))
dispatch(saveActiveGtfsEntity('trippattern'))
}
Expand Down
7 changes: 4 additions & 3 deletions lib/editor/actions/map/stopStrategies.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {stopToGeoJSONPoint,
stopToPoint,
constructPoint
} from '../../util/map'
import type {ControlPoint, Coordinates, GtfsStop, LatLng, Pattern, PatternStop, StopControlPoint} from '../../../types'
import type {ControlPoint, Coordinates, GtfsLocation, GtfsStop, LatLng, Pattern, PatternStop, StopControlPoint} from '../../../types'
import type {dispatchFn, getStateFn} from '../../../types/reducers'
import { mergePatternHalts, mergePatternHaltsOfPattern } from '../../../gtfs/util'
import { patternHaltIsLocation, patternHaltIsStopArea, patternHaltIsStop } from '../../util/location'
Expand Down Expand Up @@ -590,8 +590,8 @@ export function removeStopFromPattern (pattern: Pattern, stop: GtfsLocation | Gt
}
patternHalts.splice(index, 1)
// Update the shape_dist_traveled values if we're removing the first stop (no control point will be left in this case)
// $FLowFixMe flow doesn't understand our type check
if (index === 0) updateShapeDistTraveled(result.updatedControlPoints, result.coordinates, patternHalts.filter(ps => !!ps.stopId))
// $FlowFixMe flow doesn't understand our type check
if (index === 0) updateShapeDistTraveled(result.updatedControlPoints, result.coordinates, patternHalts)

// Update pattern geometry
dispatch(updatePatternGeometry({
Expand Down Expand Up @@ -885,6 +885,7 @@ export function updateShapesAfterPatternReorder (oldPattern: Pattern, newPattern

// Update pattern stops with cloned copy of cards (from the reorder). NOTE: stop resequencing
// is handled by updatePatternStops.
// $FlowFixMe
dispatch(updatePatternStops(oldPattern, newPatternStops))
return dispatch(saveActiveGtfsEntity('trippattern'))
}
Expand Down

0 comments on commit 427723e

Please sign in to comment.