Skip to content

Commit

Permalink
fix(EditorInput.js): Refactored the argument to compare a number with…
Browse files Browse the repository at this point in the history
… a number

The value in a gtfs option is a string, so converting to a number to make the comparrisson.

#656
  • Loading branch information
robertgregg3 committed Jul 19, 2021
1 parent ec1c526 commit da0bda5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/editor/components/EditorInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,11 @@ export default class EditorInput extends React.Component<Props> {
const routeTypes = [
{
label: 'Standard',
options: options.filter(opt => opt.value < 100).map(toOption)
options: options.filter(opt => parseInt(opt.value) < 100).map(toOption)
},
{
label: 'Extended',
options: options.filter(opt => opt.value >= 100).map(toOption)
options: options.filter(opt => parseInt(opt.value) >= 100).map(toOption)
}
]
return routeTypes.map(({label, options}) => (
Expand Down
2 changes: 1 addition & 1 deletion lib/types/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ export type GtfsSpecField = {
helpContent?: string,
inputType: InputType,
name: string,
options?: Array<{text: string, value: string | number}>,
options?: Array<{text: string, value: string}>,
placeholder?: string,
required: boolean
}
Expand Down

0 comments on commit da0bda5

Please sign in to comment.