fix to delay moving on til large pdf completed

This commit is contained in:
2025-01-16 14:06:56 +00:00
parent 9ab83efedc
commit e539b7054b
2 changed files with 93 additions and 73 deletions
+17 -9
View File
@@ -34,6 +34,8 @@ let MakeRepresentation = (props) => {
const [clearRepForm, setClearRepForm] = useState(false);
const [savingStatus, setSavingStatus] = useState(false);
const [finaliseAppealProcess, setFinaliseAppealProcess] = useState(false);
//const [questionnaireCount, setQuestionnaireCount] = useState(0);
const { data: session } = useSession();
@@ -879,7 +881,6 @@ let MakeRepresentation = (props) => {
};
const onHandleSubmit = (values) => {
window.scrollTo({ top: 0, behavior: "smooth" });
values = setRepFileName(values);
//console.log("onHandleSubmit form values - ", JSON.stringify(values));
@@ -1014,6 +1015,7 @@ let MakeRepresentation = (props) => {
setRepresentationSubmit(true);
}
}
window.scrollTo({ top: 0, behavior: "smooth" });
} else {
if (currentView.representationSubmit == true) {
console.log("capacity", currentView.representationCapacity);
@@ -1034,18 +1036,22 @@ let MakeRepresentation = (props) => {
// Object.assign(values, {
// "filesList": buildFileArray,
// })),
console.log(
"====================== rep lpa payload:\n",
JSON.stringify(values)
);
// console.log(
// "====================== rep lpa payload:\n",
// JSON.stringify(values)
// );
setFinaliseAppealProcess(true);
generateRepPDF(
values,
props.props.accountDetails.containerID,
currentView.caseReference.currentReference
);
uploadRepresentationFiles(values);
setRepresentationSubmit(true);
setRepresentationSubmitConfirmation(true);
).then((data) => {
console.log(data);
data.status == "success" &&
(uploadRepresentationFiles(values),
setRepresentationSubmit(true),
setRepresentationSubmitConfirmation(true));
});
} else {
console.log("not updated");
}
@@ -1148,6 +1154,8 @@ let MakeRepresentation = (props) => {
showQuestionnaireSection={showQuestionnaireSection}
props={props}
questionnaireCount={questionnaireCount}
finaliseAppealProcess={finaliseAppealProcess}
setFinaliseAppealProcess={setFinaliseAppealProcess}
/>
) : (
<>