mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-27 06:30:20 +00:00
fix sitemaps for unclosed nests
This commit is contained in:
parent
5f37dcc2ac
commit
86cd0ec81c
1 changed files with 18 additions and 0 deletions
|
@ -446,6 +446,24 @@ impl RouteEnum {
|
|||
routes.push(route);
|
||||
}
|
||||
|
||||
// pop any remaining site map segments
|
||||
while let Some(segment) = site_map_stack.pop() {
|
||||
let children = site_map_stack
|
||||
.last_mut()
|
||||
.map(|seg| &mut seg.last_mut().unwrap().children)
|
||||
.unwrap_or(&mut site_map);
|
||||
|
||||
// Turn the list of segments in the segments stack into a tree
|
||||
let mut iter = segment.into_iter().rev();
|
||||
let mut current = iter.next().unwrap();
|
||||
for mut segment in iter {
|
||||
segment.children.push(current);
|
||||
current = segment;
|
||||
}
|
||||
|
||||
children.push(current);
|
||||
}
|
||||
|
||||
let myself = Self {
|
||||
vis: vis.clone(),
|
||||
name: name.clone(),
|
||||
|
|
Loading…
Reference in a new issue