Only set to pristine when checkout is idle, not when idle status changes (https://github.com/woocommerce/woocommerce-blocks/pull/2485)

This commit is contained in:
Mike Jolley 2020-05-14 23:18:18 +01:00 committed by GitHub
parent 631a07dbf2
commit e5c500c70d
1 changed files with 1 additions and 1 deletions

View File

@ -268,7 +268,7 @@ export const PaymentMethodDataProvider = ( { children } ) => {
// When checkout is returned to idle, set payment status to pristine
// but only if payment status is already not finished.
useEffect( () => {
if ( ! currentStatus.isSuccessful ) {
if ( checkoutIsIdle && ! currentStatus.isSuccessful ) {
dispatch( statusOnly( PRISTINE ) );
}
}, [ checkoutIsIdle, currentStatus.isSuccessful ] );