[SM-571] reenable route reuse on destroy (#4883)
This commit is contained in:
parent
3e03c95a10
commit
ff89d86d40
|
@ -54,6 +54,7 @@ type Tasks = {
|
||||||
})
|
})
|
||||||
export class OverviewComponent implements OnInit, OnDestroy {
|
export class OverviewComponent implements OnInit, OnDestroy {
|
||||||
private destroy$: Subject<void> = new Subject<void>();
|
private destroy$: Subject<void> = new Subject<void>();
|
||||||
|
private prevShouldReuseRoute: any;
|
||||||
private tableSize = 10;
|
private tableSize = 10;
|
||||||
private organizationId: string;
|
private organizationId: string;
|
||||||
protected organizationName: string;
|
protected organizationName: string;
|
||||||
|
@ -80,6 +81,7 @@ export class OverviewComponent implements OnInit, OnDestroy {
|
||||||
* We want to remount the `sm-onboarding` component on route change.
|
* We want to remount the `sm-onboarding` component on route change.
|
||||||
* The component only toggles its visibility on init and on user dismissal.
|
* The component only toggles its visibility on init and on user dismissal.
|
||||||
*/
|
*/
|
||||||
|
this.prevShouldReuseRoute = this.router.routeReuseStrategy.shouldReuseRoute;
|
||||||
this.router.routeReuseStrategy.shouldReuseRoute = () => false;
|
this.router.routeReuseStrategy.shouldReuseRoute = () => false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,6 +135,7 @@ export class OverviewComponent implements OnInit, OnDestroy {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnDestroy(): void {
|
ngOnDestroy(): void {
|
||||||
|
this.router.routeReuseStrategy.shouldReuseRoute = this.prevShouldReuseRoute;
|
||||||
this.destroy$.next();
|
this.destroy$.next();
|
||||||
this.destroy$.complete();
|
this.destroy$.complete();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue