Skip to content

Commit

Permalink
Merge pull request #1567 from abhilash-aot/FWF-2511-Default-value-Upd…
Browse files Browse the repository at this point in the history
…ated-Custom-Subm

updated Default Value For Custom Submission
  • Loading branch information
shuhaib-aot authored Aug 17, 2023
2 parents a58b68f + 6739204 commit 961896a
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions forms-flow-web/src/components/Form/Item/Submission/Item/Edit.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useEffect , useState} from "react";
import { connect, useDispatch, useSelector } from "react-redux";
import React, { useEffect , useState, useMemo} from "react";
import { connect, useDispatch, useSelector} from "react-redux";
import {
selectRoot,
resetSubmissions,
Expand Down Expand Up @@ -51,7 +51,7 @@ const Edit = React.memo((props) => {
form: { form, isActive: isFormActive },
submission: { submission, isActive: isSubActive, url },
} = props;

const [updatedSubmissionData, setUpdatedSubmissionData] = useState({});

const applicationStatus = useSelector(
Expand Down Expand Up @@ -92,13 +92,13 @@ const Edit = React.memo((props) => {
formId,
onFormSubmit,
]);
let updatedSubmission;
if (CUSTOM_SUBMISSION_URL && CUSTOM_SUBMISSION_ENABLE) {
updatedSubmission = customSubmission;
} else {
updatedSubmission = submission;
}

let updatedSubmission = useMemo(()=>{
if (CUSTOM_SUBMISSION_URL && CUSTOM_SUBMISSION_ENABLE) {
return customSubmission;
} else {
return submission;
}
},[customSubmission,submission]);
if (isFormActive || (isSubActive && !isFormSubmissionLoading)) {
return <Loading />;
}
Expand Down Expand Up @@ -137,7 +137,7 @@ const Edit = React.memo((props) => {
redirectUrl
);
}

}
options={{
...options,
Expand Down Expand Up @@ -264,7 +264,7 @@ const mapDispatchToProps = (dispatch, ownProps) => {
)
);
}

},
onConfirm: () => {
const ErrorDetails = { modalOpen: false, message: "" };
Expand Down

0 comments on commit 961896a

Please sign in to comment.