homeflowjs 0.13.27 → 0.13.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -121,8 +121,9 @@ const hfInitialize = () => {
121
121
  || pageRoute === 'countries#show'
122
122
  || pageRoute === 'branches#properties'
123
123
  ) {
124
- const searchFromFragment = parseFragment(window.location.pathname);
124
+ let searchFromFragment = parseFragment(window.location.pathname);
125
125
  const defaultStatus = store.getState().app.themePreferences.default_search_status;
126
+ const place = Homeflow.get('place');
126
127
 
127
128
  if (!isEmpty(searchFromFragment)) {
128
129
  if (defaultStatus && !searchFromFragment.status) {
@@ -132,11 +133,19 @@ const hfInitialize = () => {
132
133
  const branchID = Homeflow.get('branch_id');
133
134
  if (branchID) searchFromFragment.branch_id = branchID;
134
135
 
136
+ if (place) {
137
+ store.dispatch(setPlace(place));
138
+ searchFromFragment = {
139
+ ...searchFromFragment,
140
+ q: place.name + (place.county_name ? `, ${place.county_name}` : ''),
141
+ place,
142
+ };
143
+ }
144
+
135
145
  store.dispatch(setInitialSearch(searchFromFragment));
136
146
  store.dispatch(setSearch(searchFromFragment));
137
147
  }
138
148
 
139
- const place = Homeflow.get('place');
140
149
  if (place) {
141
150
  const initialSearchSet = Object.keys(store.getState().search?.initialSearch)?.length;
142
151
  store.dispatch(setPlace(place));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "homeflowjs",
3
- "version": "0.13.27",
3
+ "version": "0.13.29",
4
4
  "sideEffects": [
5
5
  "modal/**/*",
6
6
  "user/default-profile/**/*",
@@ -165,7 +165,7 @@ LocationInput.propTypes = {
165
165
 
166
166
  LocationInput.defaultProps = {
167
167
  placeholder: 'Enter a location...',
168
- pattern: '',
168
+ pattern: null,
169
169
  className: '',
170
170
  suggestions: [],
171
171
  searchOnSelection: false,