Skip to content

Commit

Permalink
Experiment part 3.
Browse files Browse the repository at this point in the history
  • Loading branch information
finnbear committed Sep 12, 2024
1 parent 7f8cf94 commit 65c72b7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/yew-router/src/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,18 @@ fn base_router(props: &RouterProps) -> Html {
);
old_basename.set(basename.clone());
let location = history.location();
let stripped = old_navigator.strip_basename(Cow::Borrowed(location.path()));
let stripped = old_navigator.strip_basename(Cow::from(location.path()));
let prefixed = navigator.prefix_basename(&stripped);
if false && prefixed != location.path() {
if prefixed != location.path() {
history.replace(prefixed);
let _ = Raw(location.query_str());

/*
// Won't fail because `Raw::to_query` is infallible.
history
.replace_with_query(prefixed, Raw(location.query_str()))
.expect("failed to replace with query");
*/
}
}

Expand Down

0 comments on commit 65c72b7

Please sign in to comment.