homeflowjs 1.0.16 → 1.0.17

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.
@@ -187,7 +187,7 @@ export const postBulkPropertyExposureCreation = (payload) => () => {
187
187
  export const loadNext = () => (dispatch, getState) => {
188
188
  dispatch(setLoading({ properties: true }));
189
189
  // set page on search to page + 1
190
- let newProperties = [...getState().properties.properties];
190
+ let newProperties = [...getState().properties?.properties];
191
191
  const nextPageSearch = { ...getState().search.initialSearch };
192
192
  const currentPageNumber = getState()?.properties?.pagination?.current_page;
193
193
  const branch = Homeflow.get('branch');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "homeflowjs",
3
- "version": "1.0.16",
3
+ "version": "1.0.17",
4
4
  "sideEffects": [
5
5
  "modal/**/*",
6
6
  "user/default-profile/**/*",
@@ -449,6 +449,9 @@ export default class DraggableMap {
449
449
 
450
450
  buildPolygon() {
451
451
  const search = this.getSearch();
452
+ const place = Homeflow.get('place');
453
+ const placeObjectAllValuesNullOrEmpty = place ? Object.values(place)?.every(value => value === null || value === '') : true;
454
+
452
455
  if (Homeflow.get('enable_draw_a_map') && (search.poly != null)) {
453
456
  const polygon = new L.Polygon.fromEncoded(search.poly);
454
457
  const polygonBounds = polygon.getBounds();
@@ -460,9 +463,8 @@ export default class DraggableMap {
460
463
  });
461
464
  return this.map.fitBounds(polygonBounds);
462
465
 
463
- } else if (Homeflow.get('place') != null) {
466
+ } else if (place != null && !placeObjectAllValuesNullOrEmpty) {
464
467
  let center;
465
- const place = Homeflow.get('place');
466
468
  if (search.expandedPolygon && Homeflow.get('enable_polygon_radius_search')) {
467
469
  const expandedStyle = { weight: 2, dashArray: "8 8", color: '#000' }
468
470
  if (place.polygon.length === 1) this.buildSubPolygons(place.polygon);