fix: actually concatenate nested routes during route generation

This commit is contained in:
Greg Johnston 2024-06-14 12:41:51 -04:00
parent fbc6be922d
commit 0a41ae9a5e

View file

@ -249,18 +249,19 @@ where
match children {
None => Either::Left(iter::once(GeneratedRouteData {
segments: segment_routes,
ssr_mode
ssr_mode
})),
Some(children) => {
Either::Right(children.generate_routes().into_iter().map(move |child| {
let segments = segment_routes.clone().into_iter().chain(child.segments.into_iter()).collect();
if child.ssr_mode > ssr_mode {
GeneratedRouteData {
segments: child.segments ,
segments,
ssr_mode: child.ssr_mode,
}
} else {
GeneratedRouteData {
segments: child.segments ,
segments,
ssr_mode,
}
}