Skip to content

Commit 5ce9b35

Browse files
liamdebeasihoi4
andcommitted
fix(angular): transition plays when using browser buttons
Co-authored-by: hoi4 <[email protected]>
1 parent 2509d56 commit 5ce9b35

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/angular/common/src/providers/nav-controller.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ export class NavController {
3737
if (router) {
3838
router.events.subscribe((ev) => {
3939
if (ev instanceof NavigationStart) {
40+
// restoredState is set if the browser back/forward button is used
4041
const id = ev.restoredState ? ev.restoredState.navigationId : ev.id;
41-
this.guessDirection = id < this.lastNavId ? 'back' : 'forward';
42-
this.guessAnimation = !ev.restoredState ? this.guessDirection : undefined;
42+
this.guessDirection = this.guessAnimation = id < this.lastNavId ? 'back' : 'forward';
4343
this.lastNavId = this.guessDirection === 'forward' ? ev.id : id;
4444
}
4545
});

0 commit comments

Comments
 (0)