1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-06-28 10:55:27 +02:00

[SM-571] reenable route reuse on destroy (#4883)

This commit is contained in:
Will Martin 2023-02-27 14:46:05 -05:00 committed by GitHub
parent 3e03c95a10
commit ff89d86d40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -54,6 +54,7 @@ type Tasks = {
})
export class OverviewComponent implements OnInit, OnDestroy {
private destroy$: Subject<void> = new Subject<void>();
private prevShouldReuseRoute: any;
private tableSize = 10;
private organizationId: 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.
* The component only toggles its visibility on init and on user dismissal.
*/
this.prevShouldReuseRoute = this.router.routeReuseStrategy.shouldReuseRoute;
this.router.routeReuseStrategy.shouldReuseRoute = () => false;
}
@ -133,6 +135,7 @@ export class OverviewComponent implements OnInit, OnDestroy {
}
ngOnDestroy(): void {
this.router.routeReuseStrategy.shouldReuseRoute = this.prevShouldReuseRoute;
this.destroy$.next();
this.destroy$.complete();
}