Skip to content

Commit

Permalink
Refresh senstivity table in params when select saved params (#2155)
Browse files Browse the repository at this point in the history
Signed-off-by: achour94 <[email protected]>
  • Loading branch information
achour94 authored Jul 10, 2024
1 parent c387aca commit 410a5db
Showing 1 changed file with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -427,9 +427,9 @@ export const SensitivityAnalysisParameters = ({
};
}) ?? [],
};
reset(values);
return values;
},
[reset]
[]
);

const initRowsCount = useCallback(() => {
Expand Down Expand Up @@ -514,6 +514,7 @@ export const SensitivityAnalysisParameters = ({
keepDefaultValues: true,
}
);
initRowsCount();
})
.catch((error) => {
console.error(error);
Expand All @@ -525,13 +526,20 @@ export const SensitivityAnalysisParameters = ({
}
setOpenSelectParameterDialog(false);
},
[snackError, fromSensitivityAnalysisParamsDataToFormValues, reset]
[
snackError,
fromSensitivityAnalysisParamsDataToFormValues,
reset,
initRowsCount,
]
);

useEffect(() => {
if (sensitivityAnalysisParams) {
fromSensitivityAnalysisParamsDataToFormValues(
sensitivityAnalysisParams
reset(
fromSensitivityAnalysisParamsDataToFormValues(
sensitivityAnalysisParams
)
);
!isSubmitAction && initRowsCount();
}
Expand All @@ -540,6 +548,7 @@ export const SensitivityAnalysisParameters = ({
sensitivityAnalysisParams,
initRowsCount,
isSubmitAction,
reset,
]);

const clear = useCallback(() => {
Expand Down

0 comments on commit 410a5db

Please sign in to comment.