Fix payment status being set to pristine not working correctly

This commit is contained in:
Alex Florisca 2022-08-26 16:33:31 +01:00
parent dcffe242dd
commit dfe5151f7f
1 changed files with 5 additions and 1 deletions

View File

@ -37,7 +37,11 @@ const reducer: Reducer< PaymentMethodDataState > = (
newState = {
...state,
currentStatus: {
...state.currentStatus,
// When the status is changed to pristine, we need to reset the currentStatus properties
// to their default initial values
...( action.status?.isPristine === true
? defaultPaymentMethodDataState.currentStatus
: state.currentStatus ),
...action.status,
isFinished:
action.status.hasError ||