Skip to content

Commit

Permalink
Experiment part 4.
Browse files Browse the repository at this point in the history
  • Loading branch information
finnbear committed Sep 12, 2024
1 parent 65c72b7 commit 09463b7
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions packages/yew-router/src/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ fn base_router(props: &RouterProps) -> Html {
ctr: 0,
});

if loc_ctx.ctr > 10 {
panic!("loc ctx");
}

let basename = basename.map(|m| strip_slash_suffix(&m).to_string());
let old_basename = use_state_eq(|| Option::<String>::None);

Expand All @@ -97,15 +101,9 @@ fn base_router(props: &RouterProps) -> Html {
let stripped = old_navigator.strip_basename(Cow::from(location.path()));
let prefixed = navigator.prefix_basename(&stripped);
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");
*/
.unwrap_or_else(|never| match never {})
}
}

Expand Down

0 comments on commit 09463b7

Please sign in to comment.