Unverified Commit 3d0fbeff authored by Zhou (Link)  Fang's avatar Zhou (Link) Fang Committed by GitHub
Browse files

fixed backup issue in a specific task flow (#317)

parent 41c1f9f4
......@@ -299,6 +299,7 @@ export default function Application() {
resetMembershipLevelForm={formikMembershipLevel.resetForm}
resetWorkingGroupForm={formikWorkingGroups.resetForm}
resetSigningAuthorityForm={formikSigningAuthority.resetForm}
setUpdatedFormValues={setUpdatedFormValues}
/>
</Route>
......
......@@ -132,6 +132,7 @@ class SignIn extends React.Component {
resetMembershipLevelForm={this.props.resetMembershipLevelForm}
resetWorkingGroupForm={this.props.resetWorkingGroupForm}
resetSigningAuthorityForm={this.props.resetSigningAuthorityForm}
setUpdatedFormValues={this.props.setUpdatedFormValues}
/>
) : (
this.renderButtons(this.props.setFurthestPage)
......
......@@ -13,6 +13,7 @@ import {
} from '../../../Utils/formFunctionHelpers';
import { useCallback, useContext, useEffect, useState } from 'react';
import Loading from '../Loading/Loading';
import { initialValues } from '../FormComponents/formFieldModel';
const styles = {
marginBottom: '30px',
textAlign: 'center',
......@@ -26,6 +27,7 @@ const FormChooser = ({
resetWorkingGroupForm,
resetMembershipLevelForm,
resetCompanyInfoForm,
setUpdatedFormValues
}) => {
const { setCurrentFormId, furthestPage } = useContext(MembershipContext);
const [hasExistingForm, setHasExistingForm] = useState('');
......@@ -42,7 +44,10 @@ const FormChooser = ({
const handleStartNewForm = () => {
setIsStartNewForm(true);
if (getCurrentMode() === MODE_REACT_API) setCurrentFormId('');
setUpdatedFormValues(initialValues); // reset backup values
if (getCurrentMode() === MODE_REACT_API) {
setCurrentFormId('');
}
// reset the form if user has gone to a further page/step
if (furthestPage.index > 0) {
resetCompanyInfoForm();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment