Skip to content

Commit 7f1aed2

Browse files
committed
fix: direct user from embedded search to itinerary page if current location is used
1 parent b6e2d85 commit 7f1aed2

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)