Add check for search result sorting

Require origin to be passed to search input in case search results are
sorted by distance.
This commit is contained in:
Hannu Lyytikainen 2018-07-02 11:20:40 +03:00
parent 9333b53bb7
commit c3e77ef6bb

View file

@ -174,7 +174,9 @@ class TopbarComponent extends Component {
);
// Only render current search if full place object is available in the URL params
const locationFieldsPresent = address && bounds && country;
const locationFieldsPresent = config.sortSearchByDistance
? address && origin && bounds && country
: address && bounds && country;
const initialSearchFormValues = {
location: locationFieldsPresent
? {