diff --git a/client/src/pages/newInstall/newInstall.jsx b/client/src/pages/newInstall/newInstall.jsx index 25d0a1c..72bfd1a 100644 --- a/client/src/pages/newInstall/newInstall.jsx +++ b/client/src/pages/newInstall/newInstall.jsx @@ -18,6 +18,7 @@ import LogsInModal from '../../components/logsInModal'; import { CosmosCheckbox, CosmosInputPassword, CosmosInputText, CosmosSelect } from '../config/users/formShortcuts'; import AnimateButton from '../../components/@extended/AnimateButton'; import { Box } from '@mui/system'; +import { pull } from 'lodash'; // ================================|| LOGIN ||================================ // const NewInstall = () => { @@ -27,6 +28,7 @@ const NewInstall = () => { let [hostname, setHostname] = useState(''); const [databaseEnable, setDatabaseEnable] = useState(true); const [pullRequest, setPullRequest] = useState(null); + const [pullRequestOnSuccess, setPullRequestOnSuccess] = useState(null); const refreshStatus = async () => { try { @@ -121,6 +123,9 @@ const NewInstall = () => { }} onSubmit={async (values, { setErrors, setStatus, setSubmitting }) => { setSubmitting(true); + const submittingPromise = new Promise((resolve, reject) => { + setPullRequestOnSuccess(() => resolve); + }); setPullRequest(() => ((cb) => { API.newInstall({ @@ -129,6 +134,8 @@ const NewInstall = () => { MongoDB: values.MongoDB, }, cb) })); + + return submittingPromise; }}> {(formik) => (