mirror of
https://github.com/leptos-rs/leptos
synced 2024-11-10 06:44:17 +00:00
This commit is contained in:
parent
5ed2cc9596
commit
cfe2341dec
1 changed files with 6 additions and 0 deletions
|
@ -87,6 +87,11 @@ impl LocationProvider for BrowserUrl {
|
|||
})
|
||||
}
|
||||
|
||||
fn parse(url: &str) -> Result<Url, Self::Error> {
|
||||
let base = window().location().origin()?;
|
||||
Self::parse_with_base(url, &base)
|
||||
}
|
||||
|
||||
fn parse_with_base(url: &str, base: &str) -> Result<Url, Self::Error> {
|
||||
let location = web_sys::Url::new_with_base(url, base)?;
|
||||
Ok(Url {
|
||||
|
@ -115,6 +120,7 @@ impl LocationProvider for BrowserUrl {
|
|||
curr.origin() == new_url.origin()
|
||||
&& curr.path() == new_url.path()
|
||||
};
|
||||
|
||||
url.set(new_url);
|
||||
if same_path {
|
||||
Self::complete_navigation(&loc);
|
||||
|
|
Loading…
Reference in a new issue