fix: animations on multiple back navigations (closes #1088) (#1204)

This commit is contained in:
Greg Johnston 2023-06-17 16:47:19 -04:00 committed by GitHub
parent 18bc03e660
commit 651868dec9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 4 deletions

View file

@ -278,9 +278,12 @@ impl RouterContextInner {
let global_suspense =
expect_context::<GlobalSuspenseContext>(cx);
let path_stack = self.path_stack;
path_stack.update_value(|stack| {
stack.push(resolved_to.clone())
});
let is_navigating_back = self.is_back.get_untracked();
if !is_navigating_back {
path_stack.update_value(|stack| {
stack.push(resolved_to.clone())
});
}
let set_is_routing = use_context::<SetIsRouting>(cx);
if let Some(set_is_routing) = set_is_routing {

View file

@ -64,7 +64,9 @@ impl History for BrowserIntegration {
let is_navigating_back = path_stack.with_value(|stack| {
stack.len() == 1
|| stack.get(stack.len() - 2) == Some(&change.value)
|| (stack.len() >= 2
&& stack.get(stack.len() - 2)
== Some(&change.value))
});
if is_navigating_back {
path_stack.update_value(|stack| {