@mercoa/react 0.0.2-rc1 → 0.0.2-rc3
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 +10 -3
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +3 -3
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -45206,7 +45206,7 @@ function useProvideSession({
|
|
|
45206
45206
|
var rn;
|
|
45207
45207
|
const [ir, ar] = useState(), [sr, lr] = useState(), [ur, cr] = useState([]), [fr, mr] = useState(), [pr, dr] = useState(), [hr, yr] = useState(0), [Or, wr] = useState(), [jr, br] = useState(), [_r, xr] = useState(), [Pr, Er] = useState(ee), [Lr, Gr] = useState();
|
|
45208
45208
|
let Nr = "https://api.mercoa.com";
|
|
45209
|
-
const Vr = useMemo(() => (window && window.location && window.location.href && window.location.href.includes("staging.mercoa.com") ? Nr = "https://api.staging.mercoa.com" : window
|
|
45209
|
+
const Vr = useMemo(() => (typeof window < "u" && window && window.location && window.location.href && (window.location.href.includes("staging.mercoa.com") ? Nr = "https://api.staging.mercoa.com" : window.location.href.includes("localhost") && (Nr = "http://localhost:8080")), new javascript.MercoaClient({
|
|
45210
45210
|
environment: re ?? Nr,
|
|
45211
45211
|
token: Pr
|
|
45212
45212
|
})), [Pr]);
|
|
@@ -73171,7 +73171,7 @@ function InvoiceDetails({
|
|
|
73171
73171
|
onRedirect: ce,
|
|
73172
73172
|
addPaymentMethodRedirect: re
|
|
73173
73173
|
}) {
|
|
73174
|
-
const nr = useMercoaSession(), [or, ir] = useState(), [ar, sr] = useState(), [lr, ur] = useState(), [cr, fr] = useState(!1), [mr, pr] = useState(ee), [dr, hr] = useState(window.innerHeight - 120);
|
|
73174
|
+
const nr = useMercoaSession(), [or, ir] = useState(), [ar, sr] = useState(), [lr, ur] = useState(), [cr, fr] = useState(!1), [mr, pr] = useState(ee), [dr, hr] = useState(typeof window < "u" ? window.innerHeight - 120 : 0);
|
|
73175
73175
|
function yr() {
|
|
73176
73176
|
hr(window.innerHeight - 120);
|
|
73177
73177
|
}
|
|
@@ -74867,7 +74867,14 @@ function LineItemRow({
|
|
|
74867
74867
|
}
|
|
74868
74868
|
function EntityPortal({ token: ee }) {
|
|
74869
74869
|
var wr, jr, br, _r, xr, Pr, Er, Lr, Gr, Nr, Vr, qr, Jr, rn, on, nn, Dr, Ir, Zr, Fr, gr, Sr, Rr, Mr, vr, $r, Ar;
|
|
74870
|
-
const te = useMercoaSession(), ce = typeof window < "u" ? window.location.search : "", re = new URLSearchParams(ce), nr = Object.fromEntries(re.entries()), { invoiceId: or } = nr, [ir, ar] = useState("inbox"), [sr, lr] = useState("DRAFT"), [ur, cr] = useState(), [fr, mr] = useState(), pr = te.entity, dr = te.user, hr = te.organization
|
|
74870
|
+
const te = useMercoaSession(), ce = typeof window < "u" ? window.location.search : "", re = new URLSearchParams(ce), nr = Object.fromEntries(re.entries()), { invoiceId: or } = nr, [ir, ar] = useState("inbox"), [sr, lr] = useState("DRAFT"), [ur, cr] = useState(), [fr, mr] = useState(), pr = te.entity, dr = te.user, hr = te.organization;
|
|
74871
|
+
let yr;
|
|
74872
|
+
try {
|
|
74873
|
+
const { options: Br } = jwtDecode(ee);
|
|
74874
|
+
yr = Br;
|
|
74875
|
+
} catch (Br) {
|
|
74876
|
+
console.error(Br);
|
|
74877
|
+
}
|
|
74871
74878
|
async function Or(Br) {
|
|
74872
74879
|
await te.getNewToken(), ar(Br);
|
|
74873
74880
|
}
|