diff --git a/src/plugins/dashboard/public/application/components/dashboard_listing/__snapshots__/dashboard_listing.test.tsx.snap b/src/plugins/dashboard/public/application/components/dashboard_listing/__snapshots__/dashboard_listing.test.tsx.snap index 5e6645f56d9c..f1635f41c318 100644 --- a/src/plugins/dashboard/public/application/components/dashboard_listing/__snapshots__/dashboard_listing.test.tsx.snap +++ b/src/plugins/dashboard/public/application/components/dashboard_listing/__snapshots__/dashboard_listing.test.tsx.snap @@ -224,6 +224,7 @@ exports[`dashboard listing hideWriteControls 1`] = ` "get": [MockFunction], "getAll": [MockFunction], "getForceAppSwitcherNavigation$": [MockFunction], + "getLinkUpdaters$": [MockFunction], "getNavLinks$": [MockFunction], "has": [MockFunction], "showOnly": [MockFunction], @@ -1366,6 +1367,7 @@ exports[`dashboard listing render table listing with initial filters from URL 1` "get": [MockFunction], "getAll": [MockFunction], "getForceAppSwitcherNavigation$": [MockFunction], + "getLinkUpdaters$": [MockFunction], "getNavLinks$": [MockFunction], "has": [MockFunction], "showOnly": [MockFunction], @@ -2569,6 +2571,7 @@ exports[`dashboard listing renders call to action when no dashboards exist 1`] = "get": [MockFunction], "getAll": [MockFunction], "getForceAppSwitcherNavigation$": [MockFunction], + "getLinkUpdaters$": [MockFunction], "getNavLinks$": [MockFunction], "has": [MockFunction], "showOnly": [MockFunction], @@ -3772,6 +3775,7 @@ exports[`dashboard listing renders table rows 1`] = ` "get": [MockFunction], "getAll": [MockFunction], "getForceAppSwitcherNavigation$": [MockFunction], + "getLinkUpdaters$": [MockFunction], "getNavLinks$": [MockFunction], "has": [MockFunction], "showOnly": [MockFunction], @@ -4975,6 +4979,7 @@ exports[`dashboard listing renders warning when listingLimit is exceeded 1`] = ` "get": [MockFunction], "getAll": [MockFunction], "getForceAppSwitcherNavigation$": [MockFunction], + "getLinkUpdaters$": [MockFunction], "getNavLinks$": [MockFunction], "has": [MockFunction], "showOnly": [MockFunction], diff --git a/src/plugins/dashboard/public/application/components/dashboard_top_nav/__snapshots__/dashboard_top_nav.test.tsx.snap b/src/plugins/dashboard/public/application/components/dashboard_top_nav/__snapshots__/dashboard_top_nav.test.tsx.snap index 262deaaaeaf0..314d9e449c40 100644 --- a/src/plugins/dashboard/public/application/components/dashboard_top_nav/__snapshots__/dashboard_top_nav.test.tsx.snap +++ b/src/plugins/dashboard/public/application/components/dashboard_top_nav/__snapshots__/dashboard_top_nav.test.tsx.snap @@ -212,6 +212,7 @@ exports[`Dashboard top nav render in embed mode 1`] = ` "get": [MockFunction], "getAll": [MockFunction], "getForceAppSwitcherNavigation$": [MockFunction], + "getLinkUpdaters$": [MockFunction], "getNavLinks$": [MockFunction], "has": [MockFunction], "showOnly": [MockFunction], @@ -1179,6 +1180,7 @@ exports[`Dashboard top nav render in embed mode, and force hide filter bar 1`] = "get": [MockFunction], "getAll": [MockFunction], "getForceAppSwitcherNavigation$": [MockFunction], + "getLinkUpdaters$": [MockFunction], "getNavLinks$": [MockFunction], "has": [MockFunction], "showOnly": [MockFunction], @@ -2146,6 +2148,7 @@ exports[`Dashboard top nav render in embed mode, components can be forced show b "get": [MockFunction], "getAll": [MockFunction], "getForceAppSwitcherNavigation$": [MockFunction], + "getLinkUpdaters$": [MockFunction], "getNavLinks$": [MockFunction], "has": [MockFunction], "showOnly": [MockFunction], @@ -3113,6 +3116,7 @@ exports[`Dashboard top nav render in full screen mode with appended URL param bu "get": [MockFunction], "getAll": [MockFunction], "getForceAppSwitcherNavigation$": [MockFunction], + "getLinkUpdaters$": [MockFunction], "getNavLinks$": [MockFunction], "has": [MockFunction], "showOnly": [MockFunction], @@ -4080,6 +4084,7 @@ exports[`Dashboard top nav render in full screen mode, no componenets should be "get": [MockFunction], "getAll": [MockFunction], "getForceAppSwitcherNavigation$": [MockFunction], + "getLinkUpdaters$": [MockFunction], "getNavLinks$": [MockFunction], "has": [MockFunction], "showOnly": [MockFunction], @@ -5047,6 +5052,7 @@ exports[`Dashboard top nav render with all components 1`] = ` "get": [MockFunction], "getAll": [MockFunction], "getForceAppSwitcherNavigation$": [MockFunction], + "getLinkUpdaters$": [MockFunction], "getNavLinks$": [MockFunction], "has": [MockFunction], "showOnly": [MockFunction], diff --git a/src/plugins/workspace/public/plugin.ts b/src/plugins/workspace/public/plugin.ts index 688e61bca48f..af4ac558e5c4 100644 --- a/src/plugins/workspace/public/plugin.ts +++ b/src/plugins/workspace/public/plugin.ts @@ -25,6 +25,7 @@ type WorkspaceAppType = (params: AppMountParameters, services: Services) => () = export class WorkspacePlugin implements Plugin<{}, {}, {}> { private coreStart?: CoreStart; private currentWorkspaceSubscription?: Subscription; + private currentWorkspaceIdSubscription?: Subscription; private _changeSavedObjectCurrentWorkspace() { if (this.coreStart) { return this.coreStart.workspaces.currentWorkspaceId$.subscribe((currentWorkspaceId) => { @@ -166,7 +167,7 @@ export class WorkspacePlugin implements Plugin<{}, {}, {}> { public start(core: CoreStart) { this.coreStart = core; - this.currentWorkspaceSubscription = this._changeSavedObjectCurrentWorkspace(); + this.currentWorkspaceIdSubscription = this._changeSavedObjectCurrentWorkspace(); // When starts, filter the nav links based on the current workspace this.filterNavLinks(core); @@ -176,5 +177,6 @@ export class WorkspacePlugin implements Plugin<{}, {}, {}> { public stop() { this.currentWorkspaceSubscription?.unsubscribe(); + this.currentWorkspaceIdSubscription?.unsubscribe(); } }