fix nested nest segments
This commit is contained in:
1 parent
b1ef64126e
commit
97115f6537
2 files changed
+6
-2
No files matched your search
@@ -187,13 +187,16 @@ impl<'a> RouteTree<'a> {
|
||||
let nest = self.entries.insert(nest);
|
||||
let segments = match current_route.and_then(|id| self.get_mut(id)) {
|
||||
Some(RouteTreeSegmentData::Static { children, .. }) => children,
|
||||
Some(r) => unreachable!("{r:?} is not a static segment"),
|
||||
Some(RouteTreeSegmentData::Nest { children, .. }) => children,
|
||||
Some(r) => {
|
||||
unreachable!("{current_route:?}\n{r:?} is not a static or nest segment",)
|
||||
}
|
||||
None => &mut segments,
|
||||
};
|
||||
segments.push(nest);
|
||||
|
||||
// Update the current route
|
||||
current_route = segments.last().cloned();
|
||||
current_route = Some(nest);
|
||||
}
|
||||
|
||||
match route.next_static_segment() {
|
||||
|
||||
@@ -160,6 +160,7 @@ impl<R: Routable> WebHistory<R> {
|
||||
);
|
||||
|
||||
let current_route = myself.current_route();
|
||||
log::trace!("initial route: {:?}", current_route);
|
||||
let current_url = current_route.to_string();
|
||||
let state = myself.create_state(current_route);
|
||||
let _ = replace_state_with_url(&myself.history, &state, Some(¤t_url));
|
||||
|
||||
Reference in new issue
Block a user