propro-common-components 0.1.13 → 0.1.14
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/propro-common-components.js +11 -11
- package/package.json +1 -1
@@ -50568,24 +50568,24 @@ const initialState = {
|
|
50568
50568
|
dispatch: () => null
|
50569
50569
|
}), AppProvider = ({ children: m, baseURL: g }) => {
|
50570
50570
|
axios.defaults.baseURL = g, axios.defaults.withCredentials = !0;
|
50571
|
-
const b = (
|
50572
|
-
switch (
|
50571
|
+
const b = useRef(!0), _ = (I, R) => {
|
50572
|
+
switch (R.type) {
|
50573
50573
|
case "SET_LOADING":
|
50574
|
-
return {
|
50574
|
+
return { ...I, loading: R.payload };
|
50575
50575
|
case "SET_REQUEST_ENABLED":
|
50576
|
-
return {
|
50576
|
+
return { ...I, requestsEnabled: R.payload };
|
50577
50577
|
default:
|
50578
|
-
return
|
50578
|
+
return I;
|
50579
50579
|
}
|
50580
|
-
}, [
|
50580
|
+
}, [x, C] = useReducer(_, initialState), $ = async () => {
|
50581
50581
|
try {
|
50582
|
-
|
50583
|
-
} catch (
|
50584
|
-
console.log(
|
50582
|
+
C({ type: "SET_LOADING", payload: !0 }), await axios.post("/api/refreshToken"), C({ type: "SET_REQUEST_ENABLED", payload: !0 }), C({ type: "SET_LOADING", payload: !1 });
|
50583
|
+
} catch (I) {
|
50584
|
+
console.log(I), C({ type: "SET_LOADING", payload: !1 });
|
50585
50585
|
}
|
50586
50586
|
};
|
50587
|
-
return useEffect(() => (
|
50588
|
-
}), []), /* @__PURE__ */ jsx$2(AppContext.Provider, { value: { state:
|
50587
|
+
return useEffect(() => (b.current && !x.requestsEnabled && ($(), b.current = !1), () => {
|
50588
|
+
}), []), /* @__PURE__ */ jsx$2(AppContext.Provider, { value: { state: x, dispatch: C }, children: m });
|
50589
50589
|
}, queryClient = new QueryClient(), AppHOC = ({ children: m }) => /* @__PURE__ */ jsxs(QueryClientProvider, { client: queryClient, children: [
|
50590
50590
|
/* @__PURE__ */ jsx$2(ReactQueryDevtools, { initialIsOpen: !1 }),
|
50591
50591
|
/* @__PURE__ */ jsx$2(AppProvider, { baseURL: "", children: m })
|