fix empty nested routes

This commit is contained in:
Shahriar 2024-07-06 15:36:17 +03:30
parent deefd96159
commit 3898f04c0e

View file

@ -45,14 +45,19 @@ export class CustomFrame {
let src = new URL(this.data.url); let src = new URL(this.data.url);
if (urlSuffix) { if (urlSuffix) {
let suffix = new URL(urlSuffix, src); let suffix = new URL(urlSuffix, src.origin);
suffix.searchParams.forEach((value, key) => { suffix.searchParams.forEach((value, key) => {
src.searchParams.set(key, value); src.searchParams.set(key, value);
}); });
src.hash = suffix.hash || src.hash;
if (suffix.pathname !== "/") {
src.pathname += suffix.pathname; src.pathname += suffix.pathname;
} }
src.hash = suffix.hash || src.hash;
}
this.frame.setAttribute("src", src.toString()); this.frame.setAttribute("src", src.toString());
} }