fix(router): handle undefined catchAll param on root redirect (#5955)

This commit is contained in:
Jose Olcese authored and GitHub committed 2026-05-21 15:39:45 +02:00
1 parent 22b848f26e
commit 6ad8160aa3
1 file changed
+5 -2
+5 -2
View File
@@ -145,8 +145,11 @@ const routes = [
},
{
path: "/:catchAll(.*)*",
redirect: (to: RouteLocation) =>
`/files/${[...to.params.catchAll].join("/")}`,
redirect: (to: RouteLocation) => {
const catchAll = to.params.catchAll;
if (!catchAll) return "/files/";
return `/files/${Array.isArray(catchAll) ? catchAll.join("/") : catchAll}`;
},
},
];