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

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) ?? (t ? `app_cache_${t}` : ""), [d, T] = N(() => {
105
105
  if (!i) return null;
106
106
  try {
107
107
  const b = localStorage.getItem(l);
@@ -111,11 +111,11 @@ 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 (!(!b && i && x.current))
118
+ if (t && !(!b && i && x.current))
119
119
  try {
120
120
  c(!0), h(null);
121
121
  const o = await new Je(new he(n)).getPublicAppInfo(t);
@@ -139,7 +139,7 @@ function Sr({ config: r, children: e }) {
139
139
  },
140
140
  [n, t, i, l]
141
141
  ), I = te(async () => {
142
- if (!(!i || !x.current))
142
+ if (!(!t || !i || !x.current))
143
143
  try {
144
144
  const b = localStorage.getItem(l);
145
145
  if (!b) return;
@@ -170,7 +170,7 @@ function Sr({ config: r, children: e }) {
170
170
  [t, n, d, A, S, P]
171
171
  );
172
172
  return re(() => {
173
- x.current ? I() : P();
173
+ t && (x.current ? I() : P());
174
174
  }, []), /* @__PURE__ */ s($e.Provider, { value: R, children: e });
175
175
  }
176
176
  function Ae() {