Skip to content

Commit

Permalink
Merge pull request #252 from opentripplanner/dev
Browse files Browse the repository at this point in the history
Patch release
  • Loading branch information
landonreed authored Oct 8, 2020
2 parents 797dae8 + 0fd5e35 commit 4930580
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
8 changes: 3 additions & 5 deletions lib/components/mobile/results-screen.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import MobileNavigationBar from './navigation-bar'
import { MobileScreens, setMobileScreen } from '../../actions/ui'
import { setUseRealtimeResponse } from '../../actions/narrative'
import { clearActiveSearch } from '../../actions/form'
import { getActiveSearch, getRealtimeEffects } from '../../util/state'
import { getActiveItineraries, getActiveSearch, getRealtimeEffects } from '../../util/state'

const LocationContainer = styled.div`
font-weight: 300;
Expand Down Expand Up @@ -235,17 +235,15 @@ const mapStateToProps = (state, ownProps) => {
: useRealtime ? activeSearch.response : activeSearch.nonRealtimeResponse

const realtimeEffects = getRealtimeEffects(state.otp)

const itineraries = getActiveItineraries(state.otp)
return {
query: state.otp.currentQuery,
realtimeEffects,
error: response && response.error,
resultCount:
response
? activeSearch.query.routingType === 'ITINERARY'
? response.plan
? response.plan.itineraries.length
: 0
? itineraries.length
: response.otp.profile.length
: null,
useRealtime,
Expand Down
6 changes: 2 additions & 4 deletions lib/components/narrative/itinerary-carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class ItineraryCarousel extends Component {
state = {}
static propTypes = {
itineraries: PropTypes.array,
pending: PropTypes.bool,
pending: PropTypes.number,
activeItinerary: PropTypes.number,
hideHeader: PropTypes.bool,
itineraryClass: PropTypes.func,
Expand Down Expand Up @@ -102,9 +102,7 @@ class ItineraryCarousel extends Component {

const mapStateToProps = (state, ownProps) => {
const activeSearch = getActiveSearch(state.otp)
const itineraries = activeSearch && activeSearch.response && activeSearch.response.plan
? getActiveItineraries(state.otp)
: null
const itineraries = getActiveItineraries(state.otp)

return {
itineraries,
Expand Down
2 changes: 1 addition & 1 deletion lib/components/narrative/narrative-itineraries.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class NarrativeItineraries extends Component {
static propTypes = {
itineraries: PropTypes.array,
itineraryClass: PropTypes.func,
pending: PropTypes.bool,
pending: PropTypes.number,
activeItinerary: PropTypes.number,
setActiveItinerary: PropTypes.func,
setActiveLeg: PropTypes.func,
Expand Down
2 changes: 1 addition & 1 deletion lib/components/narrative/tabbed-itineraries.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class TabbedItineraries extends Component {
static propTypes = {
itineraries: PropTypes.array,
itineraryClass: PropTypes.func,
pending: PropTypes.bool,
pending: PropTypes.number,
activeItinerary: PropTypes.number,
setActiveItinerary: PropTypes.func,
setActiveLeg: PropTypes.func,
Expand Down

0 comments on commit 4930580

Please sign in to comment.