diff --git a/lib/claiming/components/modals/DelayClaimsModal/DelayClaimsModal.js b/lib/claiming/components/modals/DelayClaimsModal/DelayClaimsModal.js index 4d91d1ad..177ef738 100644 --- a/lib/claiming/components/modals/DelayClaimsModal/DelayClaimsModal.js +++ b/lib/claiming/components/modals/DelayClaimsModal/DelayClaimsModal.js @@ -1,4 +1,6 @@ import PropTypes from 'prop-types'; +import { useCallback } from 'react'; +import { useForm } from 'react-final-form'; import { FormattedMessage, useIntl, @@ -23,16 +25,22 @@ const DelayClaimsModal = ({ onCancel, open, }) => { + const { reset } = useForm(); const intl = useIntl(); const modalLabel = intl.formatMessage( { id: 'stripes-acq-components.claiming.modal.delayClaim.heading' }, { count: claimsCount }, ); + const handleCancel = useCallback(() => { + onCancel(); + reset(); + }, [onCancel, reset]); + const start = ( diff --git a/lib/claiming/components/modals/SendClaimsModal/SendClaimsModal.js b/lib/claiming/components/modals/SendClaimsModal/SendClaimsModal.js index 52fb3c39..9182d0b2 100644 --- a/lib/claiming/components/modals/SendClaimsModal/SendClaimsModal.js +++ b/lib/claiming/components/modals/SendClaimsModal/SendClaimsModal.js @@ -1,6 +1,10 @@ import identity from 'lodash/identity'; import PropTypes from 'prop-types'; -import { Field } from 'react-final-form'; +import { useCallback } from 'react'; +import { + Field, + useForm, +} from 'react-final-form'; import { FormattedMessage, useIntl, @@ -26,16 +30,22 @@ const SendClaimsModal = ({ open, message, }) => { + const { reset } = useForm(); const intl = useIntl(); const modalLabel = intl.formatMessage( { id: 'stripes-acq-components.claiming.modal.sendClaim.heading' }, { count: claimsCount }, ); + const handleCancel = useCallback(() => { + onCancel(); + reset(); + }, [onCancel, reset]); + const start = (