mirror of
https://github.com/bitwarden/browser
synced 2025-12-19 09:43:23 +00:00
[SM-571] reenable route reuse on destroy (#4883)
This commit is contained in:
@@ -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();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user