@zauru-sdk/hooks 2.0.188 → 2.0.196

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.
@@ -5,19 +5,13 @@ const react_1 = require("react");
5
5
  // Hook personalizado para verificar el estado de conexión
6
6
  const useIsOnline = () => {
7
7
  try {
8
- // Verificar si estamos en el entorno del servidor o del cliente
9
- const isServer = typeof window === "undefined";
10
8
  // Estado local para almacenar si la aplicación está en línea o no
11
- const [isOnline, setIsOnline] = (0, react_1.useState)(!isServer && navigator.onLine);
9
+ const [isOnline, setIsOnline] = (0, react_1.useState)(navigator.onLine);
12
10
  // Función para manejar el cambio de estado de conexión
13
11
  const handleConnectionChange = () => {
14
12
  setIsOnline(navigator.onLine);
15
13
  };
16
14
  (0, react_1.useEffect)(() => {
17
- if (isServer) {
18
- // Si estamos en el servidor, no añadir los event listeners
19
- return;
20
- }
21
15
  // Añadir event listeners
22
16
  window.addEventListener("online", handleConnectionChange);
23
17
  window.addEventListener("offline", handleConnectionChange);
@@ -26,7 +20,7 @@ const useIsOnline = () => {
26
20
  window.removeEventListener("online", handleConnectionChange);
27
21
  window.removeEventListener("offline", handleConnectionChange);
28
22
  };
29
- }, [isServer]);
23
+ }, []);
30
24
  return isOnline;
31
25
  }
32
26
  catch (ex) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zauru-sdk/hooks",
3
- "version": "2.0.188",
3
+ "version": "2.0.196",
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",
@@ -26,12 +26,12 @@
26
26
  },
27
27
  "dependencies": {
28
28
  "@remix-run/react": "^2.8.1",
29
- "@zauru-sdk/common": "^2.0.187",
29
+ "@zauru-sdk/common": "^2.0.196",
30
30
  "@zauru-sdk/icons": "^2.0.188",
31
- "@zauru-sdk/redux": "^2.0.187",
32
- "@zauru-sdk/types": "^2.0.187",
31
+ "@zauru-sdk/redux": "^2.0.196",
32
+ "@zauru-sdk/types": "^2.0.196",
33
33
  "react": "^18.2.0",
34
34
  "react-dom": "^18.2.0"
35
35
  },
36
- "gitHead": "f3ed3bfcefc6de52097b58be42f9871b867056db"
36
+ "gitHead": "44b2674d630e996212a1654751c5b8393e9a08e0"
37
37
  }