Skip to content

Commit

Permalink
fix(router): Clear internal transition when navigation finalizes (#54261
Browse files Browse the repository at this point in the history
)

This commit fixes a small memory issue in the router where a destroyed
component instance would be retained.

fixes #54241

PR Close #54261
  • Loading branch information
atscott authored and alxhub committed Feb 21, 2024
1 parent d411ee7 commit 3e31f1a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/router/src/navigation_transition.ts
Expand Up @@ -786,8 +786,9 @@ export class NavigationTransitions {
}
// Only clear current navigation if it is still set to the one that
// finalized.
if (this.currentNavigation?.id === overallTransitionState.id) {
if (this.currentTransition?.id === overallTransitionState.id) {
this.currentNavigation = null;
this.currentTransition = null;
}
}),
catchError((e) => {
Expand Down

0 comments on commit 3e31f1a

Please sign in to comment.