Skip to content

Commit

Permalink
Fix route state undefined (#2905)
Browse files Browse the repository at this point in the history
  • Loading branch information
bastianjoel authored Oct 18, 2023
1 parent 5e531de commit aa45061
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ export class RoutingStateService {
pairwise()
)
.subscribe((event: any[]) => {
this.skipUnsafeRouteCheck = router.getCurrentNavigation()?.extras?.state[`canGoBack`] ?? false;
this.skipUnsafeRouteCheck =
router.getCurrentNavigation()?.extras?.state &&
router.getCurrentNavigation()?.extras?.state[`canGoBack`];
this._previousUrl = event[0]?.urlAfterRedirects ?? this._currentUrl;
const currentNavigationExtras = router.getCurrentNavigation()?.extras;
if (currentNavigationExtras && currentNavigationExtras.state && currentNavigationExtras.state[`back`]) {
Expand Down

0 comments on commit aa45061

Please sign in to comment.