react-ecosistema-unp 1.7.1-8.pre-3 → 1.7.1-8.pre-4

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.
@@ -1,9 +1,9 @@
1
1
  import { jsx as S } from "react/jsx-runtime";
2
2
  import { useState as T, useEffect as b } from "react";
3
- import { useNavigate as y, useLocation as U, Outlet as $ } from "react-router-dom";
3
+ import { useLocation as g, Outlet as y } from "react-router-dom";
4
4
  import { j as _ } from "../../index-CuHybtft.js";
5
- const W = () => {
6
- const [k, t] = T(!1), v = y(), p = U(), s = `${window.location.protocol}//${window.location.host}/`, g = async () => {
5
+ const I = () => {
6
+ const [k, t] = T(!1), p = g(), s = `${window.location.protocol}//${window.location.host}/`, v = async () => {
7
7
  if ((await fetch(`${s}api-auth/auth/refresh_token/`, {
8
8
  method: "POST",
9
9
  headers: {
@@ -52,7 +52,7 @@ const W = () => {
52
52
  throw new Error("Token inválido");
53
53
  } catch {
54
54
  try {
55
- if (await g()) {
55
+ if (await v()) {
56
56
  const r = sessionStorage.getItem("user_token");
57
57
  if (r) {
58
58
  const a = _(r), i = a.datos_basicos.servicios.map((o) => o.url).filter((o) => !!o), c = p.pathname, h = i.map(
@@ -72,8 +72,8 @@ const W = () => {
72
72
  }
73
73
  }
74
74
  })();
75
- }, [v]), k ? /* @__PURE__ */ S($, {}) : null;
75
+ }, []), k ? /* @__PURE__ */ S(y, {}) : null;
76
76
  };
77
77
  export {
78
- W as ProtectedRoute
78
+ I as ProtectedRoute
79
79
  };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "react-ecosistema-unp",
3
3
  "author": "Ecosistema de Información - Unidad Nacional de Protección",
4
4
  "private": false,
5
- "version": "1.7.18.pre-3",
5
+ "version": "1.7.18.pre-4",
6
6
  "type": "module",
7
7
  "exports": {
8
8
  ".": {