Skip to content
Merged
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: 4 additions & 4 deletions lib/actions/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,19 +102,19 @@ export function setLocationToCurrent (payload) {
}

export function switchLocations () {
return function (dispatch, getState) {
return async function (dispatch, getState) {
const { from, to } = getState().otp.currentQuery
// First, reverse the locations.
dispatch(settingLocation({
await dispatch(settingLocation({
location: to,
locationType: 'from'
}))
dispatch(settingLocation({
await dispatch(settingLocation({
location: from,
locationType: 'to'
}))
// Then kick off a routing query (if the query is invalid, search will abort).
dispatch(routingQuery())
return dispatch(routingQuery())
}
}

Expand Down