From c77d50556cfaf8cf031a599ca219c4719be54209 Mon Sep 17 00:00:00 2001 From: neptunian Date: Wed, 27 Nov 2019 11:36:33 -0500 Subject: [PATCH] make notifications dependency explicit prop --- .../legacy/plugins/epm/public/hooks/use_package_install.tsx | 6 +++--- x-pack/legacy/plugins/epm/public/plugin.tsx | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/x-pack/legacy/plugins/epm/public/hooks/use_package_install.tsx b/x-pack/legacy/plugins/epm/public/hooks/use_package_install.tsx index 395ba358c0a5e..8f857d39f1170 100644 --- a/x-pack/legacy/plugins/epm/public/hooks/use_package_install.tsx +++ b/x-pack/legacy/plugins/epm/public/hooks/use_package_install.tsx @@ -7,7 +7,8 @@ import React, { useCallback, useState, Fragment } from 'react'; import createContainer from 'constate'; import { EuiFlexGroup, EuiFlexItem, EuiButton } from '@elastic/eui'; -import { useCore, useLinks } from '.'; +import { NotificationsStart } from 'src/core/public'; +import { useLinks } from '.'; import { installPackage as fetchInstallPackage } from '../data'; import { InstallStatus } from '../types'; import { toMountPoint } from '../../../../../../src/plugins/kibana_react/public'; @@ -18,9 +19,8 @@ interface PackagesInstall { interface PackageInstallItem { status: InstallStatus; } -function usePackageInstall() { +function usePackageInstall({ notifications }: { notifications: NotificationsStart }) { const [packages, setPackage] = useState({}); - const { notifications } = useCore(); const { toDetailView } = useLinks(); const setPackageInstallStatus = useCallback( diff --git a/x-pack/legacy/plugins/epm/public/plugin.tsx b/x-pack/legacy/plugins/epm/public/plugin.tsx index 678e48e28f4a7..9429ad4ae718c 100644 --- a/x-pack/legacy/plugins/epm/public/plugin.tsx +++ b/x-pack/legacy/plugins/epm/public/plugin.tsx @@ -48,12 +48,11 @@ export class Plugin { } function App(props: { core: PluginCore }) { - const { i18n, routes } = props.core; - + const { i18n, routes, notifications } = props.core; return ( - +