Skip to content

Commit

Permalink
Merge pull request #137 from Baptistemontan/fix_routing
Browse files Browse the repository at this point in the history
fix routing
  • Loading branch information
Baptistemontan authored Sep 21, 2024
2 parents 9e13f37 + 6a8cc70 commit 64920d8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ on:
push:
branches:
- master
- v0.4
pull_request:
branches:
- master
- v0.4

env:
CARGO_TERM_COLOR: always
Expand Down
10 changes: 8 additions & 2 deletions leptos_i18n/src/routing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,16 @@ fn get_new_path<L: Locale>(
path_builder.build()
});
location.search.with_untracked(|search| {
new_path.push_str(search);
if !search.is_empty() {
new_path.push('?');
new_path.push_str(search);
}
});
location.hash.with_untracked(|hash| {
new_path.push_str(hash);
if !hash.is_empty() {
new_path.push('#');
new_path.push_str(hash);
}
});
new_path
}
Expand Down

0 comments on commit 64920d8

Please sign in to comment.