@zauru-sdk/hooks 2.0.123 → 2.0.151

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.
@@ -70,7 +70,7 @@ function useGetReduxCatalog(CATALOG_NAME, { online = false, wheres = [], otherPa
70
70
  if (hasLocalData) {
71
71
  console.error("Hubo un error pero hay datos locales en la consulta de", CATALOG_NAME, " Error: ", error);
72
72
  setData({
73
- data: catalogData?.data || [],
73
+ data: (catalogData?.data || []),
74
74
  loading: false,
75
75
  });
76
76
  }
@@ -88,7 +88,7 @@ function useGetReduxCatalog(CATALOG_NAME, { online = false, wheres = [], otherPa
88
88
  // Si no vamos a hacer fetch, asegurarnos de que loading esté en false
89
89
  // y mantener lo que ya tengamos en Redux
90
90
  setData({
91
- data: catalogData?.data || [],
91
+ data: (catalogData?.data || []),
92
92
  loading: false,
93
93
  });
94
94
  }
@@ -27,7 +27,7 @@ function useGetTemplateObject(TEMPLATE_NAME, config = {}) {
27
27
  * - En caso contrario, mostramos datos locales y no hacemos fetch.
28
28
  */
29
29
  (0, react_2.useEffect)(() => {
30
- const mustFetch = config.online || objectData?.reFetch || !hasLocalData;
30
+ const mustFetch = config.online || !hasLocalData;
31
31
  if (mustFetch) {
32
32
  setData((prev) => ({ ...prev, loading: true }));
33
33
  dispatch((0, redux_1.templateFetchStart)(TEMPLATE_NAME));
@@ -59,7 +59,7 @@ function useGetTemplateObject(TEMPLATE_NAME, config = {}) {
59
59
  });
60
60
  }
61
61
  // eslint-disable-next-line react-hooks/exhaustive-deps
62
- }, [config.online, objectData?.reFetch, hasLocalData, TEMPLATE_NAME]);
62
+ }, [config.online, hasLocalData, TEMPLATE_NAME]);
63
63
  /**
64
64
  * 2) Efecto para cuando el fetcher termina (fetcher.state === "idle").
65
65
  * Decidimos si lo que vino es error o data, y procedemos.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zauru-sdk/hooks",
3
- "version": "2.0.123",
3
+ "version": "2.0.151",
4
4
  "description": "Hooks reutilizables dentro de las webapps de Zauru.",
5
5
  "main": "./dist/esm/index.js",
6
6
  "module": "./dist/esm/index.js",
@@ -28,10 +28,10 @@
28
28
  "@remix-run/react": "^2.8.1",
29
29
  "@zauru-sdk/common": "^2.0.118",
30
30
  "@zauru-sdk/icons": "^2.0.99",
31
- "@zauru-sdk/redux": "^2.0.121",
31
+ "@zauru-sdk/redux": "^2.0.151",
32
32
  "@zauru-sdk/types": "^2.0.109",
33
33
  "react": "^18.2.0",
34
34
  "react-dom": "^18.2.0"
35
35
  },
36
- "gitHead": "a09530092b4fe47f91456c18b9463fe012737e09"
36
+ "gitHead": "280ffceba6c2884b151241feaac047038077b3a4"
37
37
  }