diff --git a/src/renderer/src/pages/manager/index.jsx b/src/renderer/src/pages/manager/index.jsx index dede8e3..0e4025b 100644 --- a/src/renderer/src/pages/manager/index.jsx +++ b/src/renderer/src/pages/manager/index.jsx @@ -4,42 +4,36 @@ import classnames from "classnames" import BarLoader from "react-spinners/BarLoader" -import { MdAdd, MdUploadFile, MdFolder, MdDelete, MdPlayArrow, MdUpdate } from "react-icons/md" +import { MdAdd, MdFolder, MdDelete, MdPlayArrow, MdUpdate } from "react-icons/md" import { Context as InstallationsContext, WithContext } from "contexts/installations" import "./index.less" const NewInstallation = (props) => { + const { install } = React.useContext(InstallationsContext) const [manifestUrl, setManifestUrl] = React.useState("") - const handleInstall = (manifest) => { - ipc.exec("bundle:install", manifest) - .then(() => { - props.close() - }) - .catch((error) => { - antd.message.error(error) - }) + function handleClickInstall() { + install(manifestUrl) + props.close() } return