@akanjs/client 0.0.150 → 0.0.151
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/cjs/src/router.js +4 -2
- package/esm/src/router.js +4 -2
- package/package.json +1 -1
package/cjs/src/router.js
CHANGED
|
@@ -109,7 +109,9 @@ class Router {
|
|
|
109
109
|
if (location.pathname === pathname)
|
|
110
110
|
return;
|
|
111
111
|
this.#postPathChange({ path, pathname });
|
|
112
|
-
|
|
112
|
+
setTimeout(() => {
|
|
113
|
+
options.router.replace(pathname);
|
|
114
|
+
}, 0);
|
|
113
115
|
},
|
|
114
116
|
back: () => {
|
|
115
117
|
const { path, pathname } = this.#getPathInfo(document.referrer);
|
|
@@ -202,7 +204,7 @@ class Router {
|
|
|
202
204
|
getFullPath(withLang = true) {
|
|
203
205
|
if (import_base.baseClientEnv.side === "server")
|
|
204
206
|
throw new Error("getPath is only available in client side");
|
|
205
|
-
return `${withLang ? `/${this.#lang}
|
|
207
|
+
return `${withLang ? `/${this.#lang}/` : ""}${this.#prefix}${this.getPath()}`;
|
|
206
208
|
}
|
|
207
209
|
getPrefix() {
|
|
208
210
|
return this.#prefix;
|
package/esm/src/router.js
CHANGED
|
@@ -86,7 +86,9 @@ class Router {
|
|
|
86
86
|
if (location.pathname === pathname)
|
|
87
87
|
return;
|
|
88
88
|
this.#postPathChange({ path, pathname });
|
|
89
|
-
|
|
89
|
+
setTimeout(() => {
|
|
90
|
+
options.router.replace(pathname);
|
|
91
|
+
}, 0);
|
|
90
92
|
},
|
|
91
93
|
back: () => {
|
|
92
94
|
const { path, pathname } = this.#getPathInfo(document.referrer);
|
|
@@ -179,7 +181,7 @@ class Router {
|
|
|
179
181
|
getFullPath(withLang = true) {
|
|
180
182
|
if (baseClientEnv.side === "server")
|
|
181
183
|
throw new Error("getPath is only available in client side");
|
|
182
|
-
return `${withLang ? `/${this.#lang}
|
|
184
|
+
return `${withLang ? `/${this.#lang}/` : ""}${this.#prefix}${this.getPath()}`;
|
|
183
185
|
}
|
|
184
186
|
getPrefix() {
|
|
185
187
|
return this.#prefix;
|