diff --git a/forms-flow-web/src/components/Form/EditForm/index.js b/forms-flow-web/src/components/Form/EditForm/index.js index 1f4911101..624aed5ca 100644 --- a/forms-flow-web/src/components/Form/EditForm/index.js +++ b/forms-flow-web/src/components/Form/EditForm/index.js @@ -1,4 +1,4 @@ -import React, { useEffect } from "react"; +import React, { useEffect,useState } from "react"; import { useParams } from "react-router-dom"; import { useDispatch, useSelector } from "react-redux"; import { Edit as FormEdit } from './FormEdit.js'; @@ -22,7 +22,7 @@ const Index = () => { (state) => state.process?.formAuthVerifyLoading ); const apiCallError = useSelector((state) => state.errors?.apiCallError); - + const [mapperDataLoading, setMapperDataLoading] = useState(false); // fetch form and mapper data along with authorization data const errorHandling = (err) => { @@ -52,8 +52,10 @@ const Index = () => { } else { try { //TBD: need to combine these two calls + setMapperDataLoading(true); dispatch(getFormProcesses(res._id,(err, res)=>{ dispatch(getApplicationCount(res.id)); + setMapperDataLoading(false); })); const authResponse = await fetchFormAuthorizationDetials( res?.parentFormId || res._id @@ -68,7 +70,7 @@ const Index = () => { ); }, [formId]); - if (formAuthVerifyLoading) { + if (formAuthVerifyLoading || mapperDataLoading) { return ; } if (apiCallError) { diff --git a/forms-flow-web/src/components/Form/List.js b/forms-flow-web/src/components/Form/List.js index d7b8b71f1..bccb77354 100644 --- a/forms-flow-web/src/components/Form/List.js +++ b/forms-flow-web/src/components/Form/List.js @@ -293,7 +293,6 @@ const List = React.memo((props) => { setFormSubmitted(false); }); }; - console.log(form,"form"); const onChangeCheckBox = () => { const newWizardChecked = !wizardChecked;