Skip to content

Commit

Permalink
fix(angular): transition plays when using browser buttons
Browse files Browse the repository at this point in the history
Co-authored-by: hoi4 <hoi4@users.noreply.github.com>
  • Loading branch information
liamdebeasi and hoi4 committed Nov 15, 2023
1 parent 2509d56 commit 5ce9b35
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/angular/common/src/providers/nav-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ export class NavController {
if (router) {
router.events.subscribe((ev) => {
if (ev instanceof NavigationStart) {
// restoredState is set if the browser back/forward button is used
const id = ev.restoredState ? ev.restoredState.navigationId : ev.id;
this.guessDirection = id < this.lastNavId ? 'back' : 'forward';
this.guessAnimation = !ev.restoredState ? this.guessDirection : undefined;
this.guessDirection = this.guessAnimation = id < this.lastNavId ? 'back' : 'forward';
this.lastNavId = this.guessDirection === 'forward' ? ev.id : id;
}
});
Expand Down

0 comments on commit 5ce9b35

Please sign in to comment.