homeflowjs 0.8.2 → 0.8.5

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.
@@ -169,11 +169,13 @@ class InstantValuation extends Component {
169
169
  }
170
170
 
171
171
  addressLookup(postcode) {
172
+ const addressesFound = (addresses) => !!(addresses && addresses.length);
173
+
172
174
  this.setMessage('Finding addresses...');
173
175
  fetch(`/address_lookup?postcode=${postcode}`)
174
176
  .then((response) => response.json())
175
177
  .then((json) => {
176
- if (json.Message && json.Message === 'Bad Request: Invalid postcode.') {
178
+ if ((json.Message && json.Message === 'Bad Request: Invalid postcode.') || !addressesFound(json.Addresses)) {
177
179
  this.setMessage('Apologies, we do not seem to have any records for that postcode in our system. Please contact your local branch for a valuation.');
178
180
  return null;
179
181
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "homeflowjs",
3
- "version": "0.8.2",
3
+ "version": "0.8.5",
4
4
  "description": "JavaScript toolkit for Homeflow themes",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -396,6 +396,7 @@ export default class DraggableMap {
396
396
  .then((response) => response.json())
397
397
  .then(json => {
398
398
  Homeflow.kickEvent('draggable_map_updated', json);
399
+ store.dispatch(setProperties(json.properties))
399
400
  this._running_update = false;
400
401
 
401
402
  this.properties = json.properties;
@@ -74,7 +74,7 @@ const PropertiesMap = ({ leaflet, gmapKey, googleLayer }) => {
74
74
  });
75
75
 
76
76
  return (
77
- <div>
77
+ <div className="hfjs-map">
78
78
  <span id="hfjs-map-info" />
79
79
  <div id="hfjs-draggable-map" style={{ height: '100%' }} />
80
80
  </div>
@@ -31,6 +31,10 @@ class SearchForm extends Component {
31
31
  if (defaultStatus && !searchFromFragment.status) {
32
32
  searchFromFragment.status = defaultStatus;
33
33
  }
34
+
35
+ const branchID = Homeflow.get('branch_id');
36
+ if (branchID) searchFromFragment.branch_id = branchID;
37
+
34
38
  setInitialSearch(searchFromFragment);
35
39
  setSearch(searchFromFragment);
36
40
  } else {