homeflowjs 1.0.33 → 1.0.34

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "homeflowjs",
3
- "version": "1.0.33",
3
+ "version": "1.0.34",
4
4
  "sideEffects": [
5
5
  "modal/**/*",
6
6
  "user/default-profile/**/*",
@@ -9,19 +9,22 @@ const BackToSearchButton = ({ children, ...otherProps }) => {
9
9
  const lastSearch = JSON.parse(searchHistory)?.[0];
10
10
  const secondToLastSearch = JSON.parse(searchHistory)?.[1] || null;
11
11
 
12
-
13
12
  let validSearch = lastSearch;
14
13
 
15
14
  if (secondToLastSearch) {
16
- const property = Homeflow.get('property');
15
+ const property = Homeflow.get('property');
17
16
  const currentPropertyID = property?.propertyId || property?.property_id;
18
17
 
19
- if (currentPropertyID === secondToLastSearch?.clickedProperty) validSearch = secondToLastSearch;
18
+ if (currentPropertyID === secondToLastSearch?.clickedProperty) {
19
+ if ('expandedPolygon' in secondToLastSearch) {
20
+ const thirdToLastSearch = JSON.parse(searchHistory)?.[2] || null;
21
+ validSearch = thirdToLastSearch;
22
+ } else {
23
+ validSearch = secondToLastSearch;
24
+ }
25
+ }
20
26
  }
21
27
 
22
- // delete the 'place' so we don't get [object Object] in URL if place is found in object.
23
- if (validSearch?.place) delete validSearch.place;
24
-
25
28
  const href = `/search?${buildQueryString(validSearch)}`;
26
29
 
27
30
  return (
@@ -41,9 +41,10 @@ export const buildQueryString = (search) => {
41
41
  // only include either q or place ID
42
42
  if ((key === 'q' && !search.isQuerySearch)
43
43
  || (key === 'placeId' && search.isQuerySearch)
44
- || (key === 'place')
45
44
  || (key === 'poly' && search.isQuerySearch)) return;
46
45
 
46
+ if (key === 'place') return queryParams.push(`place_id=${value?.place_id}`);
47
+
47
48
  // Don't include branch_id if a search term has been entered
48
49
  if (key === 'branch_id' && search.isQuerySearch) return;
49
50