homeflowjs 1.0.85 → 1.0.86

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.
@@ -16,18 +16,20 @@ const useSearchFromFragment = ({
16
16
  const searchUrl = useCallback(() => {
17
17
  let buildUrl = `/search.ljson?channel=${channel}`;
18
18
 
19
- if (placeId) buildUrl = buildUrl += `&place_id=${placeId}`
20
- if (count) buildUrl = buildUrl += `&count=${count}`
21
-
22
- buildUrl += `&fragment=${fragment}`
23
-
24
- if (pageNumber) buildUrl += `/page-${pageNumber}`
19
+ if (placeId) buildUrl += `&place_id=${placeId}`;
20
+ if (count) buildUrl += `&count=${count}`;
21
+
22
+ buildUrl += `&fragment=${fragment}`;
23
+
24
+ if (pageNumber) buildUrl += `/page-${pageNumber}`;
25
25
 
26
26
  return buildUrl;
27
- }, []);
28
-
27
+ }, [pageNumber]);
28
+
29
29
  useEffect(() => {
30
30
  const findProperties = async () => {
31
+ setLoading(true);
32
+ setError(null);
31
33
  try {
32
34
  const searchResponse = await fetch(searchUrl());
33
35
  if (!searchResponse.ok) {
@@ -44,9 +46,8 @@ const useSearchFromFragment = ({
44
46
  }
45
47
  };
46
48
 
47
-
48
- if (foundProperties === null) findProperties();
49
- }, []);
49
+ findProperties();
50
+ }, [searchUrl]);
50
51
 
51
52
  return {
52
53
  foundProperties,
@@ -54,6 +55,6 @@ const useSearchFromFragment = ({
54
55
  error,
55
56
  loading,
56
57
  };
57
- }
58
+ };
58
59
 
59
60
  export default useSearchFromFragment;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "homeflowjs",
3
- "version": "1.0.85",
3
+ "version": "1.0.86",
4
4
  "sideEffects": [
5
5
  "modal/**/*",
6
6
  "user/default-profile/**/*",