clear-react-router 1.0.10 → 1.0.11
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.js +4 -4
- package/dist/utils/redirect.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -243,7 +243,7 @@ var l = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
|
|
|
243
243
|
constructor(e, t) {
|
|
244
244
|
this.url = e, this.search = t, this.cause = "redirect";
|
|
245
245
|
}
|
|
246
|
-
}, D = (e, t) => Promise.reject(new E(e, t)), O = ({ setLocation: e, routeList: t, context: n, revalidateCache: i }) => {
|
|
246
|
+
}, D = (e, t) => (console.log("redirect called with url", e, t), Promise.reject(new E(e, t))), O = ({ setLocation: e, routeList: t, context: n, revalidateCache: i }) => {
|
|
247
247
|
let [l, u] = c({
|
|
248
248
|
from: "",
|
|
249
249
|
to: ""
|
|
@@ -252,11 +252,11 @@ var l = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
|
|
|
252
252
|
let a = t.find((e) => T(e, r.pathname));
|
|
253
253
|
a?.beforeLoad && await a?.beforeLoad(n), e(r), r.pathname !== window.location.pathname && (history.pushState(null, "", r.pathname), d.current = r.pathname), await i(a), a?.afterLoad && await a?.afterLoad(n);
|
|
254
254
|
} catch (t) {
|
|
255
|
-
if (!(t instanceof E)) return t;
|
|
256
|
-
history.replaceState(null, "", `${t.url}${t.search || ""}`), e({
|
|
255
|
+
if (console.log("redirect caught", t), !(t instanceof E)) return t;
|
|
256
|
+
console.log("before redirect execution"), history.replaceState(null, "", `${t.url}${t.search || ""}`), e({
|
|
257
257
|
pathname: t.url,
|
|
258
258
|
search: t.search
|
|
259
|
-
});
|
|
259
|
+
}), console.log("after redirect execution");
|
|
260
260
|
}
|
|
261
261
|
}, [
|
|
262
262
|
n,
|
package/dist/utils/redirect.d.ts
CHANGED