Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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