Merge pull request #2028 from automatisch/AUT-1183

feat: update step only when data changes
This commit is contained in:
Ali BARIN
2024-08-22 16:22:16 +02:00
committed by GitHub

View File

@@ -13,6 +13,7 @@ import CircularProgress from '@mui/material/CircularProgress';
import CheckCircleIcon from '@mui/icons-material/CheckCircle'; import CheckCircleIcon from '@mui/icons-material/CheckCircle';
import { yupResolver } from '@hookform/resolvers/yup'; import { yupResolver } from '@hookform/resolvers/yup';
import * as yup from 'yup'; import * as yup from 'yup';
import { isEqual } from 'lodash';
import { EditorContext } from 'contexts/Editor'; import { EditorContext } from 'contexts/Editor';
import { StepExecutionsProvider } from 'contexts/StepExecutions'; import { StepExecutionsProvider } from 'contexts/StepExecutions';
@@ -177,7 +178,9 @@ function FlowStep(props) {
}, []); }, []);
const handleSubmit = (val) => { const handleSubmit = (val) => {
if (!isEqual(step, val)) {
handleChange({ step: val }); handleChange({ step: val });
}
}; };
const stepValidationSchema = React.useMemo( const stepValidationSchema = React.useMemo(