@opexa/portal-sdk 0.57.7 → 0.57.9
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.cjs +8 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +8 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -8850,15 +8850,19 @@ var Sdk = class {
|
|
|
8850
8850
|
const searchParams = new URLSearchParams(window.location.search);
|
|
8851
8851
|
const hostname = window.location.hostname;
|
|
8852
8852
|
const market = searchParams.get("market");
|
|
8853
|
-
const marketPattern = /^[a-zA-Z0-9]
|
|
8853
|
+
const marketPattern = /^[a-zA-Z0-9]{3,10}(-[a-zA-Z0-9]{3,10}){0,2}$/;
|
|
8854
8854
|
if (market && marketPattern.test(market)) {
|
|
8855
8855
|
sessionStorage.setItem("domain", `${hostname}/${market}`);
|
|
8856
|
-
const url = new URL(window.location.href);
|
|
8857
|
-
url.searchParams.delete("market");
|
|
8858
|
-
window.history.replaceState({}, "", url.toString());
|
|
8859
8856
|
} else if (sessionStorage.getItem("domain") == null) {
|
|
8860
8857
|
sessionStorage.setItem("domain", hostname);
|
|
8861
8858
|
}
|
|
8859
|
+
if (market) {
|
|
8860
|
+
setTimeout(() => {
|
|
8861
|
+
const url = new URL(window.location.href);
|
|
8862
|
+
url.searchParams.delete("market");
|
|
8863
|
+
window.history.replaceState({}, "", url.toString());
|
|
8864
|
+
}, 1);
|
|
8865
|
+
}
|
|
8862
8866
|
}
|
|
8863
8867
|
get webDomain() {
|
|
8864
8868
|
if (typeof window === "undefined") return null;
|