@skylabs-digital/react-identity-access 3.1.1 → 3.2.0

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.
package/dist/index.es.js CHANGED
@@ -101,7 +101,7 @@ class Je {
101
101
  const $e = fe(null), Tt = 5 * 60 * 1e3;
102
102
  function Sr({ config: r, children: e }) {
103
103
  var k, m, g;
104
- const { appId: t, baseUrl: n } = r, i = ((k = r.cache) == null ? void 0 : k.enabled) ?? !0, a = ((m = r.cache) == null ? void 0 : m.ttl) ?? Tt, l = ((g = r.cache) == null ? void 0 : g.storageKey) ?? `app_cache_${t}`, [d, T] = N(() => {
104
+ const { appId: t, baseUrl: n } = r, i = (((k = r.cache) == null ? void 0 : k.enabled) ?? !0) && !!t, a = ((m = r.cache) == null ? void 0 : m.ttl) ?? Tt, l = ((g = r.cache) == null ? void 0 : g.storageKey) ?? `app_cache_${t}`, [d, T] = N(() => {
105
105
  if (!i) return null;
106
106
  try {
107
107
  const b = localStorage.getItem(l);
@@ -111,10 +111,14 @@ function Sr({ config: r, children: e }) {
111
111
  } catch {
112
112
  return null;
113
113
  }
114
- }), [A, c] = N(!d), [S, h] = N(null), x = Ee(d);
114
+ }), [A, c] = N(!!t && !d), [S, h] = N(null), x = Ee(d);
115
115
  x.current = d;
116
116
  const P = te(
117
117
  async (b = !1) => {
118
+ if (!t) {
119
+ c(!1), h(null);
120
+ return;
121
+ }
118
122
  if (!(!b && i && x.current))
119
123
  try {
120
124
  c(!0), h(null);
@@ -139,7 +143,7 @@ function Sr({ config: r, children: e }) {
139
143
  },
140
144
  [n, t, i, l]
141
145
  ), I = te(async () => {
142
- if (!(!i || !x.current))
146
+ if (!(!t || !i || !x.current))
143
147
  try {
144
148
  const b = localStorage.getItem(l);
145
149
  if (!b) return;
@@ -170,7 +174,7 @@ function Sr({ config: r, children: e }) {
170
174
  [t, n, d, A, S, P]
171
175
  );
172
176
  return re(() => {
173
- x.current ? I() : P();
177
+ t && (x.current ? I() : P());
174
178
  }, []), /* @__PURE__ */ s($e.Provider, { value: R, children: e });
175
179
  }
176
180
  function Ae() {