Skip to content

Commit

Permalink
make notifications dependency explicit prop
Browse files Browse the repository at this point in the history
  • Loading branch information
neptunian committed Nov 27, 2019
1 parent 3763204 commit c77d505
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -18,9 +19,8 @@ interface PackagesInstall {
interface PackageInstallItem {
status: InstallStatus;
}
function usePackageInstall() {
function usePackageInstall({ notifications }: { notifications: NotificationsStart }) {
const [packages, setPackage] = useState<PackagesInstall>({});
const { notifications } = useCore();
const { toDetailView } = useLinks();

const setPackageInstallStatus = useCallback(
Expand Down
5 changes: 2 additions & 3 deletions x-pack/legacy/plugins/epm/public/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,11 @@ export class Plugin {
}

function App(props: { core: PluginCore }) {
const { i18n, routes } = props.core;

const { i18n, routes, notifications } = props.core;
return (
<EuiErrorBoundary>
<CoreProvider core={props.core}>
<PackageInstallProvider>
<PackageInstallProvider notifications={notifications}>
<i18n.Context>
<ThemeProvider theme={props.core.theme}>
<HashRouter>
Expand Down

0 comments on commit c77d505

Please sign in to comment.