Skip to content

Commit e38abe5

Browse files
authored
Merge pull request #5734 from HSLdevcom/fix-currloc-embedded
Direct user from embedded search to itinerary page if current location is used
2 parents b6e2d85 + 7f1aed2 commit e38abe5

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

app/component/embedded/EmbeddedSearch.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,12 @@ const EmbeddedSearch = (props, context) => {
245245
const executeSearch = () => {
246246
const urlEnd = bikeOnly ? '/bike' : walkOnly ? '/walk' : '';
247247

248-
// if origin or destination is missing, redirect to index page instead
249-
const isComplete = origin.address && destination.address;
248+
// if origin or destination is missing and current location is not used,
249+
// redirect to index page instead
250+
const isComplete =
251+
(origin.address && destination.address) ||
252+
origin.type === 'CurrentLocation' ||
253+
destination.type === 'CurrentLocation';
250254
const targetUrl = isComplete
251255
? buildURL([
252256
lang,

0 commit comments

Comments
 (0)