From ff89d86d407977bb369b3597811af31e8e172ddb Mon Sep 17 00:00:00 2001 From: Will Martin Date: Mon, 27 Feb 2023 14:46:05 -0500 Subject: [PATCH] [SM-571] reenable route reuse on destroy (#4883) --- .../src/app/secrets-manager/overview/overview.component.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bitwarden_license/bit-web/src/app/secrets-manager/overview/overview.component.ts b/bitwarden_license/bit-web/src/app/secrets-manager/overview/overview.component.ts index 2c092e7a61..fab91a1e30 100644 --- a/bitwarden_license/bit-web/src/app/secrets-manager/overview/overview.component.ts +++ b/bitwarden_license/bit-web/src/app/secrets-manager/overview/overview.component.ts @@ -54,6 +54,7 @@ type Tasks = { }) export class OverviewComponent implements OnInit, OnDestroy { private destroy$: Subject = new Subject(); + 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(); }