@zauru-sdk/hooks 2.0.94 → 2.0.98

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.
Files changed (2) hide show
  1. package/dist/esm/alerts.js +34 -29
  2. package/package.json +3 -3
@@ -4,34 +4,39 @@ exports.useValidateNotifications = void 0;
4
4
  const react_1 = require("react");
5
5
  const index_js_1 = require("./index.js");
6
6
  const useValidateNotifications = (source) => {
7
- const { actionData, fetcher, loaderData } = source;
8
- (0, react_1.useEffect)(() => {
9
- if (loaderData?.title) {
10
- (0, index_js_1.showAlert)({
11
- description: loaderData?.description?.toString() ?? "",
12
- title: loaderData?.title,
13
- type: loaderData?.type,
14
- });
15
- }
16
- }, [loaderData]);
17
- (0, react_1.useEffect)(() => {
18
- if (fetcher?.data?.title && fetcher.state === "idle") {
19
- (0, index_js_1.showAlert)({
20
- description: fetcher.data?.description,
21
- title: fetcher.data?.title,
22
- type: fetcher.data?.type,
23
- });
24
- }
25
- }, [fetcher?.data, fetcher?.state]);
26
- (0, react_1.useEffect)(() => {
27
- if (actionData?.title) {
28
- (0, index_js_1.showAlert)({
29
- description: actionData?.description ?? "",
30
- title: actionData?.title,
31
- type: actionData?.type,
32
- });
33
- }
34
- }, [actionData]);
35
- return null;
7
+ try {
8
+ const { actionData, fetcher, loaderData } = source;
9
+ (0, react_1.useEffect)(() => {
10
+ if (loaderData?.title) {
11
+ (0, index_js_1.showAlert)({
12
+ description: loaderData?.description?.toString() ?? "",
13
+ title: loaderData?.title,
14
+ type: loaderData?.type,
15
+ });
16
+ }
17
+ }, [loaderData]);
18
+ (0, react_1.useEffect)(() => {
19
+ if (fetcher?.data?.title && fetcher.state === "idle") {
20
+ (0, index_js_1.showAlert)({
21
+ description: fetcher.data?.description,
22
+ title: fetcher.data?.title,
23
+ type: fetcher.data?.type,
24
+ });
25
+ }
26
+ }, [fetcher?.data, fetcher?.state]);
27
+ (0, react_1.useEffect)(() => {
28
+ if (actionData?.title) {
29
+ (0, index_js_1.showAlert)({
30
+ description: actionData?.description ?? "",
31
+ title: actionData?.title,
32
+ type: actionData?.type,
33
+ });
34
+ }
35
+ }, [actionData]);
36
+ return null;
37
+ }
38
+ catch (error) {
39
+ console.log("Error in useValidateNotifications", error);
40
+ }
36
41
  };
37
42
  exports.useValidateNotifications = useValidateNotifications;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zauru-sdk/hooks",
3
- "version": "2.0.94",
3
+ "version": "2.0.98",
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",
@@ -27,11 +27,11 @@
27
27
  "dependencies": {
28
28
  "@remix-run/react": "^2.8.1",
29
29
  "@zauru-sdk/common": "^2.0.94",
30
- "@zauru-sdk/icons": "^2.0.87",
30
+ "@zauru-sdk/icons": "^2.0.98",
31
31
  "@zauru-sdk/redux": "^2.0.92",
32
32
  "@zauru-sdk/types": "^2.0.92",
33
33
  "react": "^18.2.0",
34
34
  "react-dom": "^18.2.0"
35
35
  },
36
- "gitHead": "609e3474b185d0220e35be6ea1932dee71c9dadc"
36
+ "gitHead": "d11348b60330f33f29cffbdfa4399bba8bb59c97"
37
37
  }