homeflowjs 0.13.31 → 0.13.33

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.
@@ -48,7 +48,7 @@ export const setPropertyLinksAsync = (page = null) => (dispatch) => {
48
48
 
49
49
  const nextSearch = {
50
50
  ...lastSearch,
51
- page: lastSearch.page ? lastSearch.page : 1,
51
+ page: lastSearch.page ? +lastSearch.page : 1,
52
52
  };
53
53
 
54
54
  // if there is a previous, conduct search for next
@@ -38,6 +38,6 @@ export const updateLastSearchPageInLocalStorage = (change) => {
38
38
  // Get search history from local storage
39
39
  let searchHistory = localStorage.getItem('searchHistory');
40
40
  searchHistory = searchHistory ? JSON.parse(searchHistory) : [];
41
- searchHistory[0].page = (searchHistory[0].page ? searchHistory[0].page : 1) + change;
41
+ searchHistory[0].page = (searchHistory[0].page ? +searchHistory[0].page : 1) + change;
42
42
  localStorage.setItem('searchHistory', JSON.stringify(searchHistory));
43
43
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "homeflowjs",
3
- "version": "0.13.31",
3
+ "version": "0.13.33",
4
4
  "sideEffects": [
5
5
  "modal/**/*",
6
6
  "user/default-profile/**/*",
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
3
3
  import L from 'leaflet';
4
4
  import { MapContainer, TileLayer, Marker, Popup } from 'react-leaflet';
5
5
 
6
- const PropertyLeafletMap = ({ CustomPopup }) => {
6
+ const PropertyLeafletMap = ({ CustomPopup, leafletWhenReady }) => {
7
7
  const property = Homeflow.get('property');
8
8
  const customIcon = Homeflow.get('custom_map_icon');
9
9
  const customIconAnchor = Homeflow.get('custom_map_icon_anchor');
@@ -21,6 +21,9 @@ const PropertyLeafletMap = ({ CustomPopup }) => {
21
21
  zoom={property?.agency_zoom_level || 100}
22
22
  scrollWheelZoom={false}
23
23
  style={{ height: '100%' }}
24
+ {...leafletWhenReady && {
25
+ whenReady: leafletWhenReady,
26
+ }}
24
27
  >
25
28
  <TileLayer
26
29
  attribution='&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
@@ -39,10 +42,12 @@ const PropertyLeafletMap = ({ CustomPopup }) => {
39
42
 
40
43
  PropertyLeafletMap.propTypes = {
41
44
  CustomPopup: PropTypes.elementType,
45
+ leafletWhenReady: PropTypes.func,
42
46
  };
43
47
 
44
48
  PropertyLeafletMap.defaultProps = {
45
49
  CustomPopup: null,
50
+ leafletWhenReady: null,
46
51
  };
47
52
 
48
53
  export default PropertyLeafletMap;
@@ -76,10 +76,16 @@ class PropertyMap extends React.Component {
76
76
  }
77
77
 
78
78
  render() {
79
- const { google, iconConfig, CustomPopup, placeholder } = this.props;
79
+ const { google, iconConfig, CustomPopup, placeholder, leafletWhenReady } = this.props;
80
80
 
81
81
  if (!google) {
82
- return <LazyLeafletMap iconConfig={iconConfig} CustomPopup={CustomPopup} placeholder={placeholder} />;
82
+ return (
83
+ <LazyLeafletMap
84
+ iconConfig={iconConfig}
85
+ CustomPopup={CustomPopup}
86
+ placeholder={placeholder}
87
+ leafletWhenReady={leafletWhenReady}
88
+ />);
83
89
  }
84
90
 
85
91
  return (
@@ -99,6 +105,7 @@ PropertyMap.propTypes = {
99
105
  iconConfig: PropTypes.object,
100
106
  CustomPopup: PropTypes.elementType,
101
107
  placeholder: PropTypes.object,
108
+ leafletWhenReady: PropTypes.func,
102
109
  };
103
110
 
104
111
  PropertyMap.defaultProps = {
@@ -111,6 +118,7 @@ PropertyMap.defaultProps = {
111
118
  iconConfig: null,
112
119
  CustomPopup: null,
113
120
  placeholder: <div>Loading</div>,
121
+ leafletWhenReady: null,
114
122
  };
115
123
 
116
124
  const mapDispatchToProps = {